Spinoff from http://drupal.org/node/367595#comment-1252330
_field_invoke() / _field_invoke_default() are quite powerful tools, used throughout all of field_attach operations for common tasks like 'run "something" on all the fields of an $object'. Something like a field iterator.
Currently, though, the "something" can only be:
- an operation defined by the field type (_field_invoke(), calls the field type's hook_field_*())
- a 'default', cross field-type operation defined by field.module (_field_invoke_default(), calls field_default_*())
I'm thinking it might be useful to let other modules say 'run *this* function on all the fields of an $object'.
Use case taken from http://drupal.org/node/367595#comment-1251517 (translatable fields) - extract values of the fields for the current language. Typically a "field_invoke" thing, but currently would have to be hardcoded in field.default.inc instead of done by locale.module or translation.module or whatever.
Comments
Comment #1
franzIs this still something we should pursue?
Comment #14
smustgrave CreditAttribution: smustgrave at Mobomo commentedAs there hasn't been movement in 12 years not sure this is a needed task. But if anyone disagree please reopen explaining why and updating issue summary for D10 and up.
Thanks!