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:

  1. 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.
  2. 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.
  3. 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.

None that I am aware of.

Comments

johnv’s picture

Hi 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.

johnv’s picture

Issue summary: View changes

Updated issue summary to include sandbox module link.

mparker17’s picture

Issue summary: View changes

Trying < instead of < and > instead of >

johnv’s picture

Component: Code » Integration
johnv’s picture

Status: Active » Closed (outdated)

Given the life cycle of D7, this issue is considered closed. However, patches are appreciated.