Skip to main content
expanded answer to include other optionsü
Source Link
Kartagis
  • 610
  • 7
  • 34

You need something along the lines of

<?php
$nodes = node_load_multiple(array(), array('type' => 'page'));
foreach($nodes as $node) {
  // Only modify nodes that have something in the body field
    $node->field_select['und'][0]['value'] = 'yes';
    node_save($node);
}

Modify as needed. Don't forget to clear the caches afterwards.

Another option is installing the Administrative Views and Views Bulk Operations modules, and pointing to Change Value, as seen in the below screenshot vbo and admin_views combined

You need something along the lines of

<?php
$nodes = node_load_multiple(array(), array('type' => 'page'));
foreach($nodes as $node) {
  // Only modify nodes that have something in the body field
    $node->field_select['und'][0]['value'] = 'yes';
    node_save($node);
}

Modify as needed. Don't forget to clear the caches afterwards.

You need something along the lines of

<?php
$nodes = node_load_multiple(array(), array('type' => 'page'));
foreach($nodes as $node) {
  // Only modify nodes that have something in the body field
    $node->field_select['und'][0]['value'] = 'yes';
    node_save($node);
}

Modify as needed. Don't forget to clear the caches afterwards.

Another option is installing the Administrative Views and Views Bulk Operations modules, and pointing to Change Value, as seen in the below screenshot vbo and admin_views combined

Source Link
Kartagis
  • 610
  • 7
  • 34

You need something along the lines of

<?php
$nodes = node_load_multiple(array(), array('type' => 'page'));
foreach($nodes as $node) {
  // Only modify nodes that have something in the body field
    $node->field_select['und'][0]['value'] = 'yes';
    node_save($node);
}

Modify as needed. Don't forget to clear the caches afterwards.