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.
This took me far too long to track down. Finally solved it with grep -R -A 10.
When the exif module is installed, it overwrites the options_select and options_buttons widget field types with incorrect values. The result is the two option widgets are no longer available for other fields. I experienced the issue with entityreference, but many other modules will have the same problem.
This entire hook must be removed.
/**
* Implements hook_field_widget_info_alter().
*/
function exif_field_widget_info_alter(&$info) {
$info['options_select']['field types'] = array('text', 'text_long', 'taxonomy_term_reference','date', 'datetime', 'datestamp');
$info['options_buttons']['field types'] = array('text', 'text_long', 'taxonomy_term_reference','date', 'datetime', 'datestamp');
}
Comments
Comment #1
Pierre_G CreditAttribution: Pierre_G commentedHi
I'm coming here from Entity Ref module indeed.
http://drupal.org/node/1616070
Is there any news about this ?
Comment #2
rbruhn CreditAttribution: rbruhn commentedCame here from the same issue experienced by Pierre.
Rather than remove, couldn't you simply fix it like this:
Comment #3
raphael_alla CreditAttribution: raphael_alla commentedThis bugs affects me too. Please fix ASAP
Comment #4
jphautin CreditAttribution: jphautin commentedComment #5
aasarava CreditAttribution: aasarava commentedWhat is the point of altering the options_select and options_buttons widgets just to add back in the standard types? Seems like it could be removed completely, no? Otherwise, if there's some reason it's needed, an array_merge() would probably do the trick to prevent overwriting existing values.
Comment #6
Pierre_G CreditAttribution: Pierre_G commentedAny news on this ?
Comment #7
Exploratus CreditAttribution: Exploratus commentedHappening to me also with entity reference.
Comment #8
loze CreditAttribution: loze commented+1 for removing this hook.
It doesn't appear to do anything (except break other fields). Maybe the maintainer can chime in.
I've commented out the hook in my install and everything appears to work fine.
Comment #9
jphautin CreditAttribution: jphautin commentedComment #10
tobiasbThe changes [1] introduced a bug. See #1956946: Illegal offset type in isset or empty .. field_ui_widget_type_options()
[1] http://drupalcode.org/project/exif.git/commitdiff/666785d880d7c97815342f...
Comment #11
firfin CreditAttribution: firfin commentedPatch in follow-up issue #1956946: Illegal offset type in isset or empty .. field_ui_widget_type_options() fixes that issue.
Comment #12.0
(not verified) CreditAttribution: commentedgrammar