Problem/Motivation
I want to be able to set an office hours field in a bunch of nodes all to the same value at one time.
The easiest way to accomplish this is with Views Bulk Operations and Rules.
For other types of fields, you can do this:
- Create a Rules Component (of type "Rule").
This rule takes two parameters: a node and a new value.
The rule conditions must check that the node has a certain field.
The rule actions set that field to the new value passed into the rule as a parameter. - Create a view to list nodes. Add a Views Bulk Operations field to the view and select the rule created above to make it available.
- In the view, you can select any number of nodes, and execute that rule. Rules asks for the new value, then executes the rule with that value on each node selected.
However, Rules doesn't currently know how to work with fields of type office_hours
.
Proposed resolution
In code, create a Rules Data Type so that Rules understands how to work with office_hours
fields.
Remaining tasks
I've done most of the work in a sandbox module: https://drupal.org/sandbox/mparker17/2084109
However, there are a number of things that still need to be done...
- Fix
incorrect integer value ''
error when attempting to set a field. - Fix
invalid argument supplied for foreach()
error when displaying widget. - Any remaining issues once those are resolved.
User interface changes
None.
API changes
Adds a rules data type, list<office_hours>
, which operates on an office_hours field.
Related Issues
None that I am aware of.
Comments
Comment #1
johnvHi mparker17,
we have talked before about this topic.
As an alternative/workaround, you can create a view with Editablefields. Set it as the formatter. It then shows a View (or a node page) with the OH widget.
Comment #1.0
johnvUpdated issue summary to include sandbox module link.
Comment #1.1
mparker17Trying < instead of < and > instead of >
Comment #2
johnvComment #3
johnvGiven the life cycle of D7, this issue is considered closed. However, patches are appreciated.