function _filefield_paths_drush_ffp_update in File (Field) Paths 8
Same name and namespace in other branches
- 7 filefield_paths.drush.inc \_filefield_paths_drush_ffp_update()
 
Helper function; Invokes File (Field) Paths Retroactive updates.
Parameters
array $instances: Instances collection.
1 call to _filefield_paths_drush_ffp_update()
- drush_filefield_paths_ffp_update in ./
filefield_paths.drush.inc  - Retroactively updates all File (Field) Paths of a chosen field instance.
 
File
- ./
filefield_paths.drush.inc, line 171  - Drush integration.
 
Code
function _filefield_paths_drush_ffp_update(array $instances) {
  foreach ($instances as $instance) {
    if (filefield_paths_batch_update($instance)) {
      $batch =& batch_get();
      $batch['progressive'] = FALSE;
      drush_backend_batch_process();
      drush_log(dt('!field_name File (Field) Paths updated.', [
        '!field_name' => "{$instance['label']} ({$instance['entity_type']}-{$instance['bundle']}-{$instance['field_name']})",
      ]), 'success');
    }
  }
}