I'm using an entity metadata wrapper to generate the filtered markup for an entity's text field. Pretty straightforward:
$wrapper->field_mytext->value->value();
You can see this approach endorsed at http://www.mediacurrent.com/blog/entity-metadata-wrapper, for example.
It works, except that the tokens embedded in that content do not receive the correct $data — in fact they receive no $data context at all. This is due to the fact that this module's (almost incredibly clunky) debug_backtrace
only sets up a $data context if it finds a 'field_attach_view' function in the backtrace. When the Entity API module is used, it's going through a function called 'entity_metadata_field_text_get' not 'field_attach_view'.
As things stand, is this all just an impossibility without more fundamental change across multiple modules? Seems to me that core's 'check_markup()' really needs a $context argument.
Comments
Comment #1
darvanenSome more context would be great in a number of cases.
This issue should be covered by #2075663: Improve context logic for filter processing..