PHP Fatal error: Function name must be a string in /data/webroot/sites/domino/www/profiles/domino_profile/modules/contrib/menu_minipanels/menu_minipanels.module on line 310

The problem here is that Theme Developer (http://drupal.org/project/devel_themer) has its own hook_theme_registry_alter() that moves ['link']['function'] to ['link']['original']['function'].

I'm not too familiar with how this part of the hook system works. I've worked around by changing
return $registry['link']['old function']($link);
to

  if (isset($registry['link']['old function'])) {
    return $registry['link']['old function']($link);
  }
  elseif (isset($registry['link']['original']['old function'])) {
    return $registry['link']['original']['old function']($link);
  }
  else {
    return $link;
  }

but this feels a bit of a hack as it's adding a special case for the Theme Developer module (and an else for a nicer fallback if there are any other modules with the same conflict). Is there a better way to handle this?

CommentFileSizeAuthor
#3 1992006_menu_minipanels_devel_themer.patch756 bytesdasjo

Comments

fox_01’s picture

Same prob here

alexb03060’s picture

Just ran into this problem myself. Any solutions?

dasjo’s picture

Issue summary: View changes
StatusFileSize
new756 bytes
jaydee1818’s picture

Patch #3 worked for me

ianthomas_uk’s picture

Patch #3 is my code from the issue summary. It does work, but isn't a particularly nice solution, as other modules may have the same problem.

banoodle’s picture

Patch #3 worked for me - thanks!!!!

tripper54’s picture

Status: Active » Reviewed & tested by the community

@ianthomas_uk , I agree with you that this is probably not the most elegant solution. However, it works, and doesn't break anything else, so I think it should be RTBC failing any better suggestions.

damienmckenna’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Thank you for the effort you put into this patch, I do appreciate it. However, I'm going to go with the patch from #2213851: Performance consideration for sites with large theme registry which also may improve site performance.