Publishing / Unpublishing files using views bulk operations fails.

If not explicitly set in file_admin_action_info, 'behavior' defaults to 'changes_property' this causes the entity to be re-saved in views_bulk_operations/plugins/operation_types/action.class.php/execute() with the original value after _file_mass_update_helper() is called.

This can be stopped by setting `'behavior' => array('views_property'),` in `file_admin_action_info()`;

VBO docs here https://www.drupal.org/node/2052067

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Kopecek created an issue. See original summary.

Dave Kopecek’s picture

Comment removed.

Dave Kopecek’s picture

Title: File unpublish from VBO fails to update files of type `image` » File actions from VBO fail
Issue summary: View changes
FileSize
745 bytes

Somehow resubmitted the same thing multiple times. Cleaning up. Because history.

Dave Kopecek’s picture

Issue summary: View changes
FileSize
745 bytes
mikkmiggur’s picture

FileSize
671 bytes

There seems like not correct patch file. In patch file you are removing these lines but you need to add these.
And that behavior value can be just empty 'behavior' => array(''),
From VBO docs:

(When not specified, 'behavior' defaults to having the 'changes_property' behavior. This will trigger the save action, so if you intentionally want to avoid any save actions, set 'behavior' to an empty array.)
mikkmiggur’s picture

FileSize
602 bytes

Fixed patch file.
Makefile couldn't handle the last one.