Problem/Motivation

Upgrading to views_bulk_operations from 4.4.8 to 4.4.9 breaks any views where eca_vbo is used due to deprecated code in `eca_vbo/src/Plugin/Action/VboExecute.php`

Steps to reproduce

Visit any view which has eca_vbo related actions enabled in it (after updating views_bulk_operations to 4.4.9) and get "The website encountered an unexpected error. Try again later."

The database log message reads:

Error: Call to undefined method Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase::customAccess() in Drupal\eca_vbo\Plugin\Action\VboExecute::customAccess() (line 155 of /var/www/web/modules/contrib/eca_vbo/src/Plugin/Action/VboExecute.php).

A search suggests that this error occurs because the customAccess() method was deprecated and removed in recent versions of the Views Bulk Operations (VBO) module, but eca_vbo still calls it.

Issue fork eca_vbo-3630966

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

glottus created an issue. See original summary.

mxh’s picture

mxh’s picture

Status: Active » Needs work

Thank you for the bug report and suggesting an MR. We need a different solution than MR7 suggests. We cannot just remove the event dispatching part, since users may have configured ECA workflows involving a custom access event. So removing the part would basically just ignore their configured access logic, which would be a severe security concern if we'd just remove it.

I see two options:

  1. Just assume TRUE as default access result, since in the VBO module the only logic involved for customAccess was just returning TRUE (see https://git.drupalcode.org/project/views_bulk_operations/-/commit/574c29...)
  2. Remove the whole custom access event part out of ECA VBO and create new major release version, documenting that this part is not available anymore. Also use a deploy hook that checks for any existing usage of that custom event and throw an error if that is the case, so that users are aware of it.
erutan’s picture

Can chime in with a proper MR later, but the following works for me (approach 1 vs the 2 of OP) if anyone else is getting bitten before a solution is settled on

- $event = new VboCustomAccessEvent($account, $view, parent::customAccess($account, $view), $definition, $selected_data);
+$event = new VboCustomAccessEvent($account, $view, TRUE, $definition, $selected_data);
mxh’s picture

Assigned: Unassigned » mxh

Will put in the fix as shown in #5.

  • 601fc4f6 committed on 2.1.x
    Issue #3630966 by glottus, erutan, mxh: Call to undefined method...

  • a25e36c5 committed on 1.0.x
    Issue #3630966 by glottus, erutan, mxh: Call to undefined method...
mxh’s picture

Version: 2.2.1 » 2.0.x-dev
Assigned: mxh » Unassigned
Status: Needs work » Fixed

Thank you all, will tag new release for this.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mxh changed the visibility of the branch Glottus-1.0.x-patch-27a9 to hidden.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.