| @@ -222,12 +222,14 @@ | ||
| 222 | 222 | * |
| 223 | 223 | * @return void |
| 224 | 224 | */ |
| 225 | 225 | protected function generate_displayed_value_for_field_type( $atts ) { |
| 226 | - if ( ! FrmAppHelper::is_empty_value( $this->displayed_value, '' ) ) { | |
| 227 | - $field_obj = FrmFieldFactory::get_field_object( $this->field ); | |
| 228 | - $this->displayed_value = $field_obj->get_display_value( $this->displayed_value, $atts ); | |
| 226 | + if ( FrmAppHelper::is_empty_value( $this->displayed_value, '' ) ) { | |
| 227 | + return; | |
| 229 | 228 | } |
| 229 | + | |
| 230 | + $field_obj = FrmFieldFactory::get_field_object( $this->field ); | |
| 231 | + $this->displayed_value = $field_obj->get_display_value( $this->displayed_value, $atts ); | |
| 230 | 232 | } |
| 231 | 233 | |
| 232 | 234 | /** |
| 233 | 235 | * Filter the displayed_value property |
| @@ -267,16 +269,18 @@ | ||
| 267 | 269 | * |
| 268 | 270 | * @return void |
| 269 | 271 | */ |
| 270 | 272 | protected function clean_saved_value() { |
| 271 | - if ( $this->saved_value !== '' ) { | |
| 272 | - if ( ! is_array( $this->saved_value ) && ! is_object( $this->saved_value ) ) { | |
| 273 | - $field_type = FrmField::get_field_type( $this->field ); | |
| 274 | - FrmFieldsHelper::prepare_field_value( $this->saved_value, $field_type ); | |
| 275 | - } | |
| 273 | + if ( $this->saved_value === '' ) { | |
| 274 | + return; | |
| 275 | + } | |
| 276 | 276 | |
| 277 | - if ( is_array( $this->saved_value ) && empty( $this->saved_value ) ) { | |
| 278 | - $this->saved_value = ''; | |
| 279 | - } | |
| 277 | + if ( ! is_array( $this->saved_value ) && ! is_object( $this->saved_value ) ) { | |
| 278 | + $field_type = FrmField::get_field_type( $this->field ); | |
| 279 | + FrmFieldsHelper::prepare_field_value( $this->saved_value, $field_type ); | |
| 280 | + } | |
| 281 | + | |
| 282 | + if ( is_array( $this->saved_value ) && ! $this->saved_value ) { | |
| 283 | + $this->saved_value = ''; | |
| 280 | 284 | } |
| 281 | 285 | } |
| 282 | 286 | } |