Return an object in access method

Created on 22 April 2022, over 2 years ago
Updated 24 May 2023, over 1 year ago

Problem/Motivation

When Views Bulk Operations >= 4.1.1 is installed, Image Style Warmer results in:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=401&op=do_nojs&op=do
StatusText: parsererror
ResponseText: 

...with this entry in the error reports:

Error: Call to a member function isAllowed() on bool in Drupal\views_bulk_operations\Service\ViewsBulkOperationsActionProcessor->process() (line 461 of /app/web/modules/composer/views_bulk_operations/src/Service/ViewsBulkOperationsActionProcessor.php)

This appears to be due to https://www.drupal.org/project/views_bulk_operations/issues/3272580 β†’ which says that a custom access method should return an object instead of a boolean.

Steps to reproduce

  1. Be running VBO 4.1.1 or higher
  2. Warm image styles

Proposed resolution

Access method returns an object instead of TRUE in /src/Plugin/Action/ImageStyleWarmer.php

return $object->access('view', $account, $return_as_object);

instead of

return TRUE;

πŸ› Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pelanne

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.

Production build 0.71.5 2024