(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:

  1. using theme related functions in general hook implementations (metatag, added in #1328562: Improve descriptions and other text in the module)
  2. calling views_fetch_data() inside hook_views_plugins() (entity)
  3. calling metatag_get_info() in hook_views_data() (metatag_views_field)
CommentFileSizeAuthor
#2 metatag-n2415025-2.patch1.18 KBdamienmckenna

Comments

ciss’s picture

Title: Recursion when using metatag 7.x-1.0-rc2 and above » Recursion when using entity and metatag 7.x-1.0-rc2 (and above)
Issue summary: View changes
damienmckenna’s picture

Project: Metatag Views Field » Metatag
Version: » 7.x-1.x-dev
Assigned: ciss » Unassigned
Status: Active » Needs review
StatusFileSize
new1.18 KB

Does this solve the problem?

damienmckenna’s picture

Title: Recursion when using entity and metatag 7.x-1.0-rc2 (and above) » l() in metatag_metatag_info() creates recursion bug
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Let me know if the problem persists and we can take another look.

  • DamienMcKenna committed 306c6e2 on 7.x-1.x
    Issue #2415025 by DamienMcKenna: l() in metatag_metatag_info() creates...
ciss’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.