RomanL 6 lat temu
rodzic
commit
97c7b67b82

+ 7 - 5
modules/base/general/classes/BxBaseModGeneralFormEntry.php

@@ -213,11 +213,13 @@ class BxBaseModGeneralFormEntry extends BxTemplFormView
 				'value' =>  $sValue
 			));
         }
-        return $this->oTemplate->parseHtmlByName('form_view_row.html', array(
-            'type' => $aInput['type'], 
-            'caption' => isset($aInput['caption']) ? bx_process_output($aInput['caption']) : '',
-            'value' => $sResult
-        ));
+        if ($sResult != ''){
+            return $this->oTemplate->parseHtmlByName('form_view_row.html', array(
+                'type' => $aInput['type'], 
+                'caption' => isset($aInput['caption']) ? bx_process_output($aInput['caption']) : '',
+                'value' => $sResult
+            ));
+        }
     }
     
     protected function genGhostTemplateForInputNestedForm (&$aInput)

+ 6 - 0
modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

@@ -454,6 +454,12 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
         if (!$oForm->delete ($aContentInfo[$CNF['FIELD_ID']], $aContentInfo))
             return _t('_sys_txt_error_entry_delete');
 
+        // remove data from nested forms 
+        $aNestedForms = BxDolFormQuery::getNestedFormObjects($oForm->aParams['object']);
+        foreach ($aNestedForms as $aNestedForm) {
+            BxDolFormQuery::deleteDataFromNestedForm($aNestedForm['table'], $iContentId);
+        }
+        
         if ($sResult = $this->onDataDeleteAfter ($aContentInfo[$CNF['FIELD_ID']], $aContentInfo, $oProfile))
             return $sResult;