Hot answers tagged

5

Instead of \Drupal::service('router.builder')->rebuild() you can invalidate route matches: Cache::invalidateTags(['route_match']); You don't need to rebuild the router table, because the static routes don't change. What you need to clear are route matches, which are calculated on the processed path and then stored for the unprocessed path. And this is ...


2

Your route doesn't have a parameter called node, so therefore $node is null. In order to make node available as a parameter you have to be on a route that has node as a parameter. So to add the node parameter to your route, you can do like this: rsvplist.form: path: '/rsvplist/{node}' defaults: _form: '\Drupal\rsvplist\Form\RSVPForm' _title: '...


2

The _node_operation_route option respect the Use the administration theme when editing or creating content, if you want to explicitly disable admin theme for this node-related page don't use _node_operation_route The _node_operation_route option overrides _admin_route https://api.drupal.org/api/drupal/core%21modules%21node%21src%21EventSubscriber%...


Only top voted, non community-wiki answers of a minimum length are eligible