Download & Extend

Extend the "modify entity values" action to add a delete mode for multiple-value properties and fields

Project:Views Bulk Operations (VBO)
Version:7.x-3.x-dev
Component:Core
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

The "modify entity values" action has a specific behavior for multiple-value properties (such as "User roles") and fields (any field with cardinality bigger than 1):
It adds an "Add new value(s) to %label, instead of overwriting the existing values." checkbox below the widget, with obvious results.

For this action to be a complete replacement for the old "modify taxonomy" action (#1142062: Port taxonomy term operations to d7 ) we also need a "delete" mode, which will delete the selected values if found in the values of the passed entity.
Of course, this can only work with multi-value fields that have a selection of predefined items (such as product reference fields), can't work for free-entry elements such as textfields.
So the code should be modified, instead of the "Add" checkbox we should have three "mode" radio buttons (replace/add/delete). The delete mode should only be supported for fields with the property_info type of list<$entity_type> (and perhaps list and list, need to check).

There's also a question of how to have this look nice in the UI. Thinking of perhaps having a "Options for field %field_label" fieldset around it.

Comments

#1

+1

This is a good idea. We could use this for taxonomy terms on nodes. In some cases we may want to remove just an occurrence of a term while *preserving* the others.

nobody click here