← All changes
|
includes/Frontend/Form/View/Theme/Fields/TextField.php
+4
-1
3.1.4
→
3.3.1
View file →
| @@ -7,8 +7,11 @@ | ||
| 7 | 7 | class TextField |
| 8 | 8 | { |
| 9 | 9 | public static function init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = null) |
| 10 | 10 | { |
| 11 | + if (!is_object($field)) { | |
| 12 | + return ''; | |
| 13 | + } | |
| 11 | 14 | $inputWrapper = new ClassicInputWrapper($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value); |
| 12 | 15 | $input = self::field($field, $rowID, $form_atomic_Cls_map, $value, $formID); |
| 13 | 16 | return $inputWrapper->wrapper($input); |
| 14 | 17 | } |
| @@ -41,9 +44,9 @@ | ||
| 41 | 44 | $sugg = apply_filters('bitform_field_suggestions_datalist', '', $field, $rowID, $contentCount); |
| 42 | 45 | |
| 43 | 46 | $showPickerAttr = self::showPickerAttr($field); |
| 44 | 47 | |
| 45 | - if (property_exists($field, 'suggestions') && count($field->suggestions) > 0) { | |
| 48 | + if (is_object($field) && property_exists($field, 'suggestions') && is_countable($field->suggestions) && count($field->suggestions) > 0) { | |
| 46 | 49 | $list = "list='{$rowID}-{$contentCount}-datalist'"; |
| 47 | 50 | } |
| 48 | 51 | |
| 49 | 52 | return sprintf( |