Steps to reproduce:

Create a rules component "action set" define first parameter as "list of node items".
My component creates a node, loops through the list and updates entityreference-field value in list-item to be the node created.

All of the above works, but notice as below is thrown afterwards:

Notice: Undefined variable: account in views_bulk_operations_direct_process() (line 1167 of /home/.../public_html/.../sites/all/modules/views_bulk_operations/views_bulk_operations.module).

I'm using the latest dev version of the module. I Also noted that in views this "list type" of component is missing the recently committed " Skip permission step" checkbox.

I tried with component that takes "any entity"(single entity) as parameter and does the same as described above >> all works perfectly, no notices.
I would use this approach but if user selects more than one item from list, the component creates the new node multiple times, and every time reference to this most recently created node... Result would be 1-1, 2-2, 3-3, 4-4... Not 1-1, 1-2, 1-3, 1-4...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Status: Active » Needs review

Solution to this seems to be a defined variable :D

Who knew...

Add:

$account = user_load($user->uid);

Below

function views_bulk_operations_direct_process($operation, $rows, $options) {
  global $user;

In:
views_bulk_operations.module

CvW’s picture

Since $account is only used once, and $user not, it is easier to replace $account by $user in _views_bulk_operations_entity_access.

kevineinarsson’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed but please in the future make patches relative to the module folder

  • joelpittet committed d7638c8 on 7.x-3.x authored by CvW
    Issue #2473889 by CvW: rules component with list as parameter creates a...
joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for the patch and the review. I've committed and pushed this to the dev branch.

Status: Fixed » Closed (fixed)

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

m.stenta’s picture

Attached is a patch made relative to the module folder - for anyone who needs to apply it via Drush Make while we wait for the next release of VBO.

Thanks @CvW for the fix!

Leaving this as closed...