Last active
August 29, 2015 14:09
-
-
Save nadavoid/75f8dcd451e0c5375f63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Example of programmatically executing a patch process. | |
// @see https://api.drupal.org/api/drupal/includes!form.inc/function/batch_process/7 | |
// @see https://www.drupal.org/node/873132 | |
// @see pathauto_bulk_update_form_submit() | |
$callback = 'user_pathauto_bulk_update_batch_process'; | |
$batch = array( | |
'title' => t('Bulk updating URL aliases'), | |
'operations' => array( | |
array('pathauto_bulk_update_batch_start', array()), | |
), | |
'finished' => 'pathauto_bulk_update_batch_finished', | |
'file' => drupal_get_path('module', 'pathauto') . '/pathauto.admin.inc', | |
); | |
$settings = (object) array( | |
'module' => 'node', | |
'token_type' => 'node', | |
'groupheader' => 'Content paths', | |
'patterndescr' => 'Pattern for content page paths', | |
'patterndefault' => 'content/[node:title]', | |
'batch_update_callback' => 'node_pathauto_bulk_update_batch_process', | |
'batch_file' => 'profiles/asi/modules/contrib/pathauto/pathauto.pathauto.inc', | |
'patternitems' => array( | |
'initiative' => 'Pattern for all Initiative Paths', | |
'news' => 'Pattern for all News Paths', | |
'page' => 'Pattern for all Page Paths', | |
'post' => 'Pattern for all Post Paths', | |
'shared_story' => 'Pattern for all Shared Story Paths', | |
), | |
); | |
$batch['operations'][] = array( | |
'pathauto_bulk_update_batch_process', | |
array($callback, $settings), | |
); | |
batch_set($batch); | |
$batch =& batch_get(); | |
$batch['progressive'] = FALSE; | |
batch_process(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment