-
Notifications
You must be signed in to change notification settings - Fork 99
null value is possible when array is expected #767
Copy link
Copy link
Closed
Milestone
Description
The render_field() method in the Fieldmanager_Context class has the following code:
$data = array_key_exists( 'data', $args ) ? $args['data'] : null;
...
$field = $this->fm->element_markup( $data );This makes it possible for $data to be null. However, the element_markup() method that's called above (from the Fieldmanager_Field class) expects an array only.
* @param array $values The current values of this element, in a tree structure
...
public function element_markup( $values = array() ) {
$values = $this->preload_alter_values( $values );Likewise, the preload_alter_values() method that's immediately called also expects and returns an array.
* @param array $values The values to load.
* @return array $values The loaded values.
*/
public function preload_alter_values( $values ) {
return apply_filters( 'fm_preload_alter_values', $values, $this );
}Reactions are currently unavailable