From d2ba2e0c8bf083e42f7dd303343d59a43106f101 Mon Sep 17 00:00:00 2001
From: Uma <uma.s@vtiger.com>
Date: Wed, 11 Dec 2019 18:06:02 +0530
Subject: [PATCH] Fixes #1225 Custom block deletion with no fields

---
 modules/Settings/LayoutEditor/actions/Block.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/Settings/LayoutEditor/actions/Block.php b/modules/Settings/LayoutEditor/actions/Block.php
index ea3345a8d..ae22b4a4a 100644
--- a/modules/Settings/LayoutEditor/actions/Block.php
+++ b/modules/Settings/LayoutEditor/actions/Block.php
@@ -80,8 +80,8 @@ class Settings_LayoutEditor_Block_Action extends Settings_Vtiger_Index_Action {
         $response = new Vtiger_Response();
         $blockId = $request->get('blockid');
         $checkIfFieldsExists = Vtiger_Block_Model::checkFieldsExists($blockId);
-        if(!$checkIfFieldsExists) {
-            $response->setError('502','Fields not exists for the block');
+        if($checkIfFieldsExists) {
+            $response->setError('502','Fields exists for the block');
             $response->emit();
             return;
         }
-- 
GitLab