Suppose I have the following route in my ej.routing.yml file:
ej.form.user.profile: path: '/user/{user}/ej_profile' defaults: _title: 'EJ Profile' _form: 'DrupalejFormUserProfileForm' requirements: _role: 'authenticated' user: d+
Now I want to add a menu based on the above route to Tools menu. So I use the following in ej.links.menu.yml file:
ej.user.profile: title: 'EJ Profile' description: 'EJ Profile' route_name: ej.form.user.profile menu_name: tools weight: 100
However this gives me an exception saying: SymfonyComponentRoutingExceptionMissingMandatoryParametersException: Some mandatory parameters are missing (“user”) to generate a URL for route “ej.form.user.profile”.
The same works as a task entry. Basically I have a custom form that extends user profile to integrate with a third-party system and I need the user id from the url to fetch appropriate user’s information.
How can I have the menu to pick route parameter from the url?
Sponsored by SupremePR