We did not get the module to work without this small patch.
It tells Drupal for which field types the hidden widget is allowed. And you need to select a widget before you can select a formatter and save the field.
| Comment | File | Size | Author |
|---|---|---|---|
| field_types.patch | 383 bytes | batje |
Comments
Comment #1
batje commentedneeds review
Comment #2
xen commentedThis will add the hidden widget as an option to all fields, which I don't think is a good idea (how would any normal field react to using it) or makes sense (normal fields only get their data from a widget).
And I can't see how that patch can work for you, $fields is unset, so the end result should be the same.
The correct solution is to implement hook_field_widget_info_alter() and add your virtual field to the field types of the hidden widget.
However, it's such a common case to only use the hidden widget, so I think it would make sense that virtual_field automatically adds field types which has the hidden widget as default_widget to the supported field types, eliminating the need to implement hook_field_widget_info_alter() in the field module, so I'm changing this issue.
Comment #3
xen commentedCommitted a patch that allows virtual fields to specify add_widget in the options, in order to not have to implement hook_widget_info_alter() to get the hidden widget.