Error: Cannot modify readonly property Drupal\views_bulk_operations\Plugin\Action\CancelUserAction::$currentUser

Created on 22 October 2024, about 1 month ago

We installed the 4.3.0 version of the module yesterday afternoon, and may have found a little bug in the code.

We realized an error when attempting to update an ECA* model.
*[Referred Module: (https://drupal.org/project/eca)]

When attempting to edit the ECA model a php error was reported:

Error: Cannot modify readonly property Drupal\views_bulk_operations\Plugin\Action\CancelUserAction::$currentUser in Drupal\views_bulk_operations\Plugin\Action\CancelUserAction->__construct() (line 51 of /modules/contrib/views_bulk_operations/src/Plugin/Action/CancelUserAction.php).

We went to the php file that the error report directed us to, and found that a piece of the code may have a typo.

/modules/contrib/views_bulk_operations/src/Plugin/Action/CancelUserAction.php

Possible issue in code below: (starting at line 16 from above file)

/**
* Cancel a user account.
*/
#[Action(
id: 'vbo_cancel_user_action',
label: new TranslatableMarkup('Cancel the selected user accounts'),
type: 'user'
)]

After commenting out this above code, the error was resolved. Not sure if this actually solved the problem though.

We have since reverted the code to the original state, and are awaiting confirmation, or revision.

Thank you for your time, otherwise great module!

🐛 Bug report
Status

Active

Version

4.3

Component

Actions

Created by

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

Comments & Activities

Production build 0.71.5 2024