function admin_apply_draft_changes_form_submit

7.x admin.module admin_apply_draft_changes_form_submit($form, $form_submit)
6.x admin.module admin_apply_draft_changes_form_submit($form, $form_submit)
5.x admin.module admin_apply_draft_changes_form_submit($form, $form_submit)

We are going to set up a batch operation for apply draft changes, to reduce the chance of it timing out with large amounts of data.

File

modules/admin/admin.module, line 1309
The administrative configurations for FlightPath.

Code

function admin_apply_draft_changes_form_submit($form, $form_submit) {


  // We are going to keep track of all the operations we need to do in this $ops array.
  $ops = array();
  $ops []['truncate_prod_and_copy'] = 'courses';
  $ops []['truncate_prod_and_copy'] = 'degree_requirements';
  $ops []['truncate_prod_and_copy'] = 'degree_tracks';
  $ops []['truncate_prod_and_copy'] = 'degrees';
  $ops []['truncate_prod_and_copy'] = 'group_requirements';
  $ops []['truncate_prod_and_copy'] = 'groups';


  $ops []['perform_draft_instructions'] = TRUE;

  $ops []['invoke_apply_draft_changes'] = TRUE;

  $ops []['rebuild_cache_course_inventory'] = TRUE;



  // Okay, set up the batch....
  $batch = array(
    "operation" => array("admin_apply_draft_changes_perform_batch_operation", array($ops)),
    "title" => t("Apply draft changes"),
    "success_message" => t("Draft changes have been applied successfully."),
    "progress_message" => "Working on @current of @total operations...",
    "display_percent" => TRUE,
  );


  // Set the batch...
  batch_set($batch);



}