Skip to content

Instantly share code, notes, and snippets.

@aschmoe
Created January 28, 2015 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aschmoe/831f8946a0af90412e22 to your computer and use it in GitHub Desktop.
Save aschmoe/831f8946a0af90412e22 to your computer and use it in GitHub Desktop.
Drupal: Views bulk operation to move a file without affecting node update date
<?php
// Dont include the php tag in the VBO interface
if(!empty($entity->field_picture) && empty($entity->field_pictures_multiple)) {
$entity->field_pictures_multiple['und'] = array($entity->field_picture['und'][0]);
field_attach_update('node', $entity);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment