Call to member function isAllowed() on true

Created on 11 October 2024, about 1 month ago

Im getting the following error while using the vbo action of entity pdf download in the default content view:

Call to a member function isAllowed() on true in Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor->process() (line 448 of modules/contrib/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessor.php). Drupal\views_bulk_operations\ViewsBulkOperationsBatch::operation(Array, Array) (Line: 296)

I have the latest version of the module.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

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

Comments & Activities

  • Issue created by @mfv
  • 🇮🇳India abhishek_virasat

    I have resolved locally this error, but can't upload patch or MR in this entity_pdf issue . because that is related to views_bulk_operations module. you can make changes in Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor->process() function

    replace this line
    if ($accessResult->isAllowed() === FALSE) {

    to

    // Only call isAllowed() if $accessResult is an instance of AccessResultInterface
    if ($accessResult instanceof AccessResultInterface && $accessResult->isAllowed() === FALSE) {

    and replace this line '@reason' => $accessResult->getReason(), to '@reason' => $reason,

Production build 0.71.5 2024