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.
Issue fork component_library-3316106
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
Comment #3
s_leu commentedComment #4
s_leu commentedComment #6
s_leu commentedComment #8
tim bozeman commentedTiny tweak to get satisfy the tests. Thank you Sebastian! 🚀