
For use relation objects in custom widget is useful to move relation query from "hook_field_prepare_view" and "hook_field_widget_form" to the "hook_field_load". Result of the relation_dummy_field_field_load should be $items filled by IDs of relations.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1361380_move-field-logic-to-load_5.patch | 863 bytes | naught101 |
relation-dummy.patch | 1.65 KB | Honza Pobořil |
Comments
Comment #1
Honza Pobořil commentedCould you commit this patch if you agree?
Comment #3
Honza Pobořil commentedBtw, are you agree with this feature? I don't want to waste my time with writing tests if this feature is not welcome.
Comment #4
naught101 commentedThis seems intuitively reasonable, however I'm not sure about the benefit, or whether there might be some drawbacks. What's the rationale? Are you sure this is the sensible thing to do?
Comment #5
naught101 commentedWhy not just do this?
Also, relation_dummy_field really needs some tests. This seems to work, but I'm a bit worried about it breaking something else.
Comment #6
naught101 commentedBecause https://api.drupal.org/api/drupal/modules!field!field.api.php/function/h... says loading fieldable entities in hook_field_load is a bad idea (possibilities of infinite recursion).