Route "view.my_invitations.page_1" does not exist

Created on 17 March 2023, over 1 year ago
Updated 21 April 2023, over 1 year ago

Problem/Motivation

A RouteNotFoundException is thrown when the current user gets notified (via the notifyAboutPendingInvitations method in GinviteSubscriber.php) and the views module is disabled:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "view.my_invitations.page_1" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 of core/lib/Drupal/Core/Routing/RouteProvider.php).

Steps to reproduce

  1. Disable views module
  2. Create a group
  3. Create a user
  4. Create an invitation for that user
  5. Login as that user and trigger the notifyAboutPendingInvitations method

Proposed resolution

Check if the route 'view.my_invitations.page_1' exists before creating a link to that view page.

Remaining tasks

The patch will check if the route exists, but I think there is a better solution. The route name is (and was) hardcoded, so if the view display ID changes, it wil stop working.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇳🇱Netherlands Ewout Goosmann

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024