UserLocalTask does not check that route exists

Created on 14 June 2022, over 2 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

After #3253955: Let modules opt in to the bundle-specific permissions form β†’ , a bundle entity type can declare a route provider and link template in its class annotations in order to create the "Manage Permissions" tab.

When creating local tasks, Drupal\user\Plugin\Derivative\UserLocalTask::getDerivativeDefinitions() checks for the link template but does not check for the route. If the link template is there and the route is not, then any page where the local task is added throws an exception.

Steps to reproduce

  1. Install Drupal (9.4.0-beta1 or later) with the Standard profile.
  2. Delete the line below from modules/taxonomy/src/Entity/Vocabulary.php.
  3. Clear caches.
  4. Visit /admin/structure/taxonomy/manage/tags.
  5. Get a WSOD with the message, 'Route "entity.taxonomy_vocabulary.entity_permissions_form" does not exist.'
 *       "permissions" = "Drupal\user\Entity\EntityPermissionsRouteProvider",

Proposed resolution

Inject the route provider into the local task deriver. Check that the route exists before using it.

Remaining tasks

User interface changes

None

API changes

This adds a parameter to the constructor for the local task deriver Drupal\user\Plugin\Derivative\UserLocalTask.

Data model changes

None

Release notes snippet

N/A

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
User moduleΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot β†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

Production build 0.71.5 2024