You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warning: Array to string conversion in field_read_instances() (line 757 of /var/www/html/backdrop/core/modules/field/field.crud.inc).
This led me to look into field_read_instances, where the contrib module was sending $params['field_name'] as an array of field names. The code seems to expect a string for this optional property -- but looking up to the docblock for verification, I don't see this property listed:
Interestingly I just ran across this again in a different module. It looks like D7 allowed an array of values for field_name -- should we change the function to allow for that, or document the change to only allow a single value for field_name?
Drupal 7 allows to use an array for field_name because $query->condition('fci.' . $key, $value); (used by field_read_instances()) could either accept a single value for $value or an array.
The functions calling field_read_instances() should not count on that, as that is not documented in Drupal 7, in the same way they should not count on the fact they could pass an array for entity_type too.
Description of the bug
I ran into a warning in a contrib module:
This led me to look into
field_read_instances
, where the contrib module was sending$params['field_name']
as an array of field names. The code seems to expect a string for this optional property -- but looking up to the docblock for verification, I don't see this property listed:The text was updated successfully, but these errors were encountered: