Note: while #358617: How to bulk edit cck fields? appears similar, it has evolved into something much different than this simple case of editing bulk CCK fields.

Steps to reproduce:

  1. Add blank, new CCK text field Y to existing content type.
  2. On view with VBO and only Modify node fields (views_bulk_operations_fields_action) selected, check the box next to Y.
  3. In the Y's Code column, insert this:
    return array(
      0 => array('value' => $field_X[0]['view']),
    );

    (Field X is also a text field and has text in it.)

  4. Select all nodes below.
  5. Modify node fields
  6. Confirm

When taken back to the view, I get this at the top:

3 rows processed in about 465 ms:

    * Performed Modify node fields on node A.
    * Performed Modify node fields on node B.
    * Performed Modify node fields on node C.

But when inspecting the nodes, field Y remains blank.

Comments

aren cambre’s picture

Title: Doesn't bulk edit CCK fields » Doesn't bulk edit CCK fields with PHP

Make title more focused to separate it from #358617: How to bulk edit cck fields?, which is more about inserting a static value into a field.

infojunkie’s picture

Assigned: Unassigned » infojunkie

Thanks for your report, I'll take a look at it.

infojunkie’s picture

Category: bug » support

In step 3 of your description, your code is incorrect. Instead of

return array(
  0 => array('value' => $field_X[0]['view']),
);

you should write

return array(
  0 => array('value' => $node->field_X[0]['value']),
);

The variable $node is available to you, and to know how to refer to the right value in a field, please use devel.module's dev load tab.

aren cambre’s picture

Status: Active » Fixed

Thank you.

Status: Fixed » Closed (fixed)

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