Przeglądaj źródła

#5616 Forms: php error in custom inputs

Aleksandr Trofimov 2 miesięcy temu
rodzic
commit
cb0d6c86ca
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      template/scripts/BxBaseFormView.php

+ 4 - 2
template/scripts/BxBaseFormView.php

@@ -458,8 +458,10 @@ class BxBaseFormView extends BxDolForm
 
             if ($bType && 'custom' == $aInput['type']){
                 $sCustomMethod = 'genCustomInput' . $this->_genMethodName($aInput['name']);
-                if (method_exists($this, $sCustomMethod))
-                     $aInput = $this->$sCustomMethod($aInput);
+                if (method_exists($this, $sCustomMethod)) {
+                     $mixed = $this->$sCustomMethod($aInput);
+                     $aInput = is_array($mixed) ? $mixed : ['type' => 'custom', 'content' => $mixed];
+                }
             }
 
             if ($bType && 'block_header' == $aInput['type']){