- Issue created by @d.fisher
- Merge request !143Defend against null entities in LocalTaskUsageController. → (Open) created by d.fisher
When I try and edit an existing paragraph using Drupal 11.2.2 and entity_usage 2.0.0-beta24 I see the error:
Error: Call to a member function getEntityTypeId() on null in Drupal\entity_usage\Controller\LocalTaskUsageController->checkAccessLocalTask() (line 26 of .../src/Controller/LocalTaskUsageController.php)
I no longer have access to the local tasks such as 'manage form display' and 'manage display' as well.
Install Drupal 11.2.2.
Install Paragraphs 1.19.0
Create a paragraph with some fields.
Install Entity Usage 2.0.0-beta24
Enable entity usage on paragraphs
Try to edit the paragraph you created.
You will see the error at the bottom of the screen and in the log messages.
I'm unsure if it's the correct approach but the issue can be resolved by adding some defensive checks in LocalTaskUsageController.php although someone with a deeper understanding of the module should check if this approach is appropriate, safe, and robust.
I will create a branch and MR to demonstrate how I've fixed this.
This will need to be reviewed.
N/A
N/A
N/A
Active
2.0
Code