Fix error: Call to a member function getEntityTypeId() on bool

Created on 26 November 2023, 12 months ago
Updated 27 November 2023, 12 months ago

Problem/Motivation

I faced an issue when I used Moderation Sidebar β†’ module with access policy as below:
Error: Call to a member function getEntityTypeId() on bool in Drupal\access_policy\Controller\EntityAccessPolicy->access() (line 123 of modules/contrib/access_policy/src/Controller/EntityAccessPolicy.php).

Drupal Version: 10.1.5
Access Policy: 1.0.0-beta5
Moderation Sidebar: 8.x-1.7

Steps to reproduce

1- Enable access policy module.
2- Enable moderation sidebar module.
3- Open any content and click on the sidebar link.
4- The ajax call will fail and the above error will appear.

Proposed resolution

I suggest to check the entity first before checking if the page enabled isSelectionPageEnabled

Remaining tasks

Patch

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan Odai Atieh Amman

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024