Problem/Motivation

Enable this module and menu_item_extras


Fatal error: Cannot redeclare template_preprocess_menu_link_content() (previously declared in /var/www/html/docroot/modules/contrib/menu_item_extras/menu_item_extras.theme.inc:20) in /var/www/html/docroot/modules/contrib/menu_link_content_revisions_ui/menu_link_content_revisions_ui.theme.inc on line 17

Steps to reproduce

Enable both modules.

Proposed resolution

Rename the function?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

agentrickard created an issue. See original summary.

jastraat’s picture

This is unfortunately due to the fact that the menu_link_content module doesn't provide a theme template itself. If you want to successfully render for example revisions, it needs to be present. Both this module and menu_item_extras needed that theme template and couldn't build on one provided by the core menu_link_content module and we both used the same logical name for that template function.

Let me a dig a bit.

jastraat’s picture

Status: Active » Needs review

I renamed the preprocess function to be module specific and everything continues to work when menu_item_extras is not present.

That said, both modules are using the same theme hook naming which I'm not sure can be avoided, so could you test if simply renaming that preprocess function addresses the issues with using both modules? Thanks!

jastraat’s picture

@agentrickard could you review?

jasongose’s picture

*note* I tested with Drupal 10.5.6 and used the 3.1.0 release of menu_item_extras
With the 1.0.0 release of menu_link_content_revisions_ui, this reproduces the error.

Updating to the merge request resolves the error :)

Looks good to me

jasongose’s picture

Status: Needs review » Reviewed & tested by the community

This passes my review and works with 3.1 of menu_item_extras

  • jastraat committed d2843dc9 on 1.0.x
    bug: #3556733 Incompatible template call when used with menu_item_extras...
jastraat’s picture

Status: Reviewed & tested by the community » Fixed

Thanks Jason!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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