| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace BitCode\BitForm\Frontend\Form\View\Theme; |
| 4 | 4 | |
| 5 | +use BitCode\BitForm\Frontend\Form\View\Theme\Fields\AddressField; | |
| 5 | 6 | use BitCode\BitForm\Frontend\Form\View\Theme\Fields\ButtonField; |
| 6 | 7 | use BitCode\BitForm\Frontend\Form\View\Theme\Fields\CheckBoxField; |
| 7 | 8 | use BitCode\BitForm\Frontend\Form\View\Theme\Fields\CountryField; |
| 8 | 9 | use BitCode\BitForm\Frontend\Form\View\Theme\Fields\CurrencyField; |
| @@ -38,8 +39,11 @@ | ||
| 38 | 39 | |
| 39 | 40 | public function inputWrapper($formViewInstance, $rowID) |
| 40 | 41 | { |
| 41 | 42 | $field = $formViewInstance->fields($rowID); |
| 43 | + if (!is_object($field)) { | |
| 44 | + return ''; | |
| 45 | + } | |
| 42 | 46 | $field_name = $formViewInstance->getFieldName($rowID); |
| 43 | 47 | $form_atomic_Cls_map = $formViewInstance->getAtomicClaMap(); |
| 44 | 48 | $error = $formViewInstance->getError($rowID); |
| 45 | 49 | $value = $formViewInstance->getValue($field_name, $rowID); |
| @@ -83,8 +87,12 @@ | ||
| 83 | 87 | } |
| 84 | 88 | |
| 85 | 89 | protected function getField($field, $rowID, $field_name, $form_atomic_Cls_map, $error = null, $value = null, $formID = null) |
| 86 | 90 | { |
| 91 | + if (!is_object($field)) { | |
| 92 | + return ''; | |
| 93 | + } | |
| 94 | + | |
| 87 | 95 | // Pro-only fields ship in the Bit Form Pro plugin. In the free plugin, we avoid rendering Pro implementations. |
| 88 | 96 | $proMissingHtml = '<div class="bf-pro-field-missing"> <!-- Require Bit Form Pro --> </div>'; |
| 89 | 97 | |
| 90 | 98 | switch ($field->typ) { |
| @@ -102,8 +110,10 @@ | ||
| 102 | 110 | case 'password': |
| 103 | 111 | case 'email': |
| 104 | 112 | case 'name': |
| 105 | 113 | return FieldWithChild::init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value); |
| 114 | + case 'address': | |
| 115 | + return AddressField::init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value); | |
| 106 | 116 | case 'textarea': |
| 107 | 117 | return TextAreaField::init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value); |
| 108 | 118 | case 'range': |
| 109 | 119 | return SliderField::init($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value); |