IAB2EnabledAccess::access() should always return an AccessResult

Created on 27 June 2024, 4 months ago
Updated 19 September 2024, about 1 month ago

Problem/Motivation

When a module adds a custom entity operation, the access control handler doesn't return an AccessResult, resulting in the following error.
TypeError: Argument 1 passed to Drupal\Core\Access\AccessResult::orIf() must implement interface Drupal\Core\Access\AccessResultInterface, null given, called in /var/www/html/web/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php on line 105 in Drupal\Core\Access\AccessResult->orIf() (line 282 of /var/www/html/web/core/lib/Drupal/Core/Access/AccessResult.php)

Proposed resolution

Add a return AccessResult::neutral(); to the function in the case there is no return

🐛 Bug report
Status

RTBC

Version

4.5

Component

Code

Created by

🇬🇧United Kingdom nexusnovaz

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024