(Note: Originally filed for metatag_views_field)
In rare cases a call to l() in hook_metatag_info() can cause infinite recursion.
Scenario: When the entity module is enabled, calling metatag_get_info() inside hook_views_data() with an emptied cache will cause all involved caches to be rebuilt. As l() has theme support this triggers a rebuild of the theme registry.
This rebuild will cause views_theme() to fire which in turn invokes hook_views_plugins(). This hook is implemented by the entity module, and inside the implementation views_fetch_data() gets invoked, triggering hook_views_data() all over again (as no call to module_invoke_all() has finished at this point, and thus no cached data is available).
It can be argued where the bad practice / responsibility for this bug lies:
- using theme related functions in general hook implementations (metatag, added in #1328562: Improve descriptions and other text in the module)
- calling views_fetch_data() inside hook_views_plugins() (entity)
- calling metatag_get_info() in hook_views_data() (metatag_views_field)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | metatag-n2415025-2.patch | 1.18 KB | damienmckenna |
Comments
Comment #1
ciss commentedComment #2
damienmckennaDoes this solve the problem?
Comment #3
damienmckennaComment #4
damienmckennaCommitted. Let me know if the problem persists and we can take another look.
Comment #6
ciss commented