Problem/Motivation

NOTICE: PHP message: AssertionError: $url must be a string or object of type \Drupal\Core\Url in /var/www/html/web/core/lib/Drupal/Core/Template/TwigExtension.php on line 246 #0 /var/www/html/web/core/lib/Drupal/Core/Template/TwigExtension.php(246): assert(false, '$url must be a ...')

It seems to be coming from the menu_links() in twig or the macro_menu_links() in the compiled template.

Steps to reproduce

On a Vanilla Drupal 9.5.x

  • Install component_library
  • Navigate to home and click the override button on the top right of the toolbar
  • Click on a menu link, for example Home
  • In the override form modal, enter a name for the override and click on Save

This will fail with the AJAX error as documented above.

Proposed resolution

Implement an event subscriber that is able to replace URL variables in override templates.

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

Tim Bozeman created an issue. See original summary.

s_leu made their first commit to this issue’s fork.

s_leu’s picture

Issue summary: View changes
s_leu’s picture

Issue summary: View changes

s_leu’s picture

Status: Active » Needs review

  • 8a34a80 committed on 1.0.x
    Issue #3316106: Implemented an event subscriber that adds placeholder...
tim bozeman’s picture

Status: Needs review » Fixed

Tiny tweak to get satisfy the tests. Thank you Sebastian! 🚀

Status: Fixed » Closed (fixed)

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