| @@ -19,8 +19,16 @@ | ||
| 19 | 19 | * |
| 20 | 20 | * @return void |
| 21 | 21 | */ |
| 22 | 22 | public function render( $field_settings, $form_id ) { |
| 23 | + /** | |
| 24 | + * Ensure the field name is set. There have been cases where the name array key is not set. | |
| 25 | + * Not sure why and we were unable to replicate without manually removing the key. | |
| 26 | + * This is a failsafe to ensure the field name is set. | |
| 27 | + */ | |
| 28 | + if ( ! isset( $field_settings['name'] ) ) { | |
| 29 | + $field_settings['name'] = 'custom_html'; | |
| 30 | + } | |
| 23 | 31 | $use_theme_css = isset( $form_settings['use_theme_css'] ) ? $form_settings['use_theme_css'] : 'wpuf-style'; |
| 24 | 32 | ?> |
| 25 | 33 | <li <?php $this->print_list_attributes( $field_settings ); ?>> |
| 26 | 34 | <div class="wpuf-fields <?php echo 'html_' . esc_attr( $form_id ); ?><?php echo ' wpuf_'. esc_attr( $field_settings['name'] ).'_'. esc_attr( $form_id ); ?>" data-style="<?php echo esc_attr( $use_theme_css ); ?>"> |