Views bulk operation not working on nodes

Created on 17 December 2024, 1 day ago

Problem/Motivation

When using views bulk operations and views bulk edit and trying to use the "Edit content" operation, the page throws a WSOD with the following error:

Uncaught PHP Exception Error: "Call to undefined method Drupal\views_bulk_operations\Form\ConfigureAction::getEntity()" at /var/www/html/site/modules/contrib/simplify/simplify.module line 583

This is similar to this other issue πŸ› Bulk operation not working on nodes. Fixed .

Proposed resolution

Proposing the same fix to check if the getEntity method exists.

Modify the simplify_hide_widget function in simplify.module:

function simplify_hide_widget(string $name, array &$form, FormStateInterface $form_state) {

  // Check whether the method exists before continuing.
  if (!method_exists($form_state->getFormObject(), 'getEntity')) {
    return;
  }

  $entity = $form_state->getFormObject()->getEntity();
  $entity_type = $entity->getEntityTypeId();
πŸ› Bug report
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States todea

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

Comments & Activities

Production build 0.71.5 2024