Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting the following error when trying to use the Geocoder field widget to encode from another field on a Message entity:
Warning: array_key_exists(): The first argument should be either a string or an integer in geocoder_field_field_widget_settings_form() (line 45 of sites/all/modules/geocoder/modules/geocoder_field/geocoder_field.module).
I traced it back to the following code:
$title_field = $entities[$instance['entity_type']]['entity keys']['label'];
$all_fields[$title_field] = array(
'field_name' => $title_field,
'type' => 'text',
);
$entity_fields['title']['label'] = t(drupal_ucfirst($title_field));
The Message entity doesn't define ['entity keys']['label']
, it sets it to FALSE
instead. I'm not sure if this is a fault with the Message module or not.
Comment | File | Size | Author |
---|---|---|---|
#3 | geocoder-array_key_exists-type-warning-2708177-2-d7.patch | 1.53 KB | thirdender |
#2 | geocoder-array_key_exists-type-warning-2708177-1-d7.patch | 1.28 KB | thirdender |
Comments
Comment #2
thirdender CreditAttribution: thirdender commentedComment #3
thirdender CreditAttribution: thirdender commentedI actually found another module that does not define an 'label' entity key. The Message module defines
['entity keys']['label']
asFALSE
, but the Field Collection module leaves the label completely undefined. I've tweaked the patch so that it fixes this issue for both the Message and Field Collection entity types, and hopefully any other entity type that doesn't define a label.Comment #5
PolThanks!
Comment #6
tusharbodke CreditAttribution: tusharbodke as a volunteer and at Faichi Solutions Pvt Ltd commentedHi Pol & thirdender,
Updating this case as it look like resolved and patch is already merge to module.
Reopen if required.
Thanks
Comment #7
tusharbodke CreditAttribution: tusharbodke as a volunteer and at Faichi Solutions Pvt Ltd commented