We're using field_extrawidgets for the D7 port of the Project* suite. Very helpful, thanks!
However, I just noticed a kind of drastic UI #fail. ;) Once you enable this module and it injects itself as widget choices into the Field UI, it always puts itself first, and "Hidden" becomes the default widget choice for all new fields you define through the UI. I know this module isn't intended for folks using the field UI as their primary site building approach, but it seems like it'd be nice to not default to the totally wrong thing in the vast majority of field creation cases. ;) If this is an advanced module, it shouldn't put itself as the default choice.
Although, Field API #fail, I don't see any support for weights or anything at hook_field_widget_info() so I'm not even sure how you're supposed to inject yourself last instead of first. :(
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1586334-3.field_extrawidgets_if_1586356_lands.patch | 600 bytes | dww |
| #1 | 1586334-1.field_extrawidgets_should_be_last_evilhack.patch | 886 bytes | dww |
Comments
Comment #1
dwwI'm totally ashamed to even share such a patch, but based on my limited research into the limitations in the Field API, this appears to be the only way to control where in the UI your widgets shows up. Ugh. :(
Comment #2
dwwAt the encouragement of webchick and catch in IRC, I opened #1586356: Missing 'weight' support from hook_field_widget_info() makes it impossible to sanely order widgets about trying to add weight support for widgets (the widgets themselves, not the weight of the widgets in the entity form) in core.
Comment #3
dwwOr, if #1586356: Missing 'weight' support from hook_field_widget_info() makes it impossible to sanely order widgets lands, this. ;) Note: it wouldn't hurt to commit this anyway -- the 'weight' keys would be ignored by core until the other patch lands. But whatever.
Comment #4
amateescu commentedAgreed with the patch from #3.
Comment #5
damien tournoud commentedI merged #1 into 7.x-1.x as a stop-gap solution. Let's wait for #1586356: Missing 'weight' support from hook_field_widget_info() makes it impossible to sanely order widgets to get #3 in.
Comment #6
jpstrikesback commentedDoes hook_field_widget_info_alter() need a module key as indicated here:
Notice: Undefined index: module in function_field_info_prepare_instance_widget()
?
Comment #7
dwwFYI #1586356: Missing 'weight' support from hook_field_widget_info() makes it impossible to sanely order widgets is now in both D8 and D7 core, so the real fix from #3 is now available.
Cheers,
-Derek
Comment #8
jpstrikesback commentedNice!
Comment #9
amateescu commentedOk, so the core patch will be in D7.16 so I reverted the patch from #1 and committed the one from #3.
I'm going to wait with the 7.x-1.1 release until Drupal 7.16 is out.
This also fixes #1728488: Notice: Undefined index: module в _field_info_prepare_instance_widget().
http://drupalcode.org/project/field_extrawidgets.git/commit/6094862
http://drupalcode.org/project/field_extrawidgets.git/commit/ac77308