URL = http://tylerfrankenstein.com/code/drupal-batch-example /** * The batch processor. */ function my_module_batch_fix_process($word, &$context) { // Do heavy lifting here… // Display a progress message… $context[‘message’] = “Now processing $word…”; } /** * The batch finish handler. */ function my_module_batch_fix_finished($success, $results, $operations) { if ($success) { drupal_set_message(‘Fix is complete!’); } else { $error_operation = reset($operations); $message = t(‘An error occurred while processing %error_operation with arguments: @arguments’, array( ‘%error_operation’ => $error_operation[0], ‘@arguments’ => print_r($error_operation[1], TRUE) )); drupal_set_message($message, ‘error’); } drupal_set_message(l(‘Run again’, ‘my_module/batch_fix’)); }
Followers
Tuesday, 16 January 2018
How to create Batch in Drupal 6, 7 with Example
Recommended Articles
- Drupal
Drupal 8 Backend Specialist Exam Study Stuff.Jun 25, 2018
Drupal Module Basics Module programming fundamentals Drupal code standards Creating custom-programmed Drupal blocks Implementing custom block acces...
- Drupal
User can delete own profile and its contentJan 24, 2018
I've added my first #module at "Drupal.org" for #drupal 7. basically, this #module is created to so that authenticated users can delete their profi...
- Drupal
How to create Batch in Drupal 6, 7 with ExampleJan 16, 2018
URL = http://tylerfrankenstein.com/code/drupal-batch-example /** * The batch processor. */ function my_module_batch_fix_process($word, &$conte...
- Drupal
How To Prevent To Customer To Add Same Credit Card On Stripe In PhpJan 16, 2018
I’ve written the following php code in my web app to check for this. # Retrieve the customer we’re adding this token to $customer = \Stripe\C...
Labels:
Drupal
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment