Browse Source

Merge pull request #526 from jordandukart/7.x-FLVC-64

Magic to get around a core Drupal problem.
pull/528/head
Adam 10 years ago
parent
commit
5658f0d06a
  1. 6
      includes/ingest.form.inc
  2. 16
      islandora.module

6
includes/ingest.form.inc

@ -706,7 +706,11 @@ function islandora_ingest_form_ingest_button(array &$form_state) {
$validate_callback = $form_id . '_validate';
$validate = function_exists($validate_callback) ? array($validate_callback) : NULL;
$submit_callback = $form_id . '_submit';
$submit = function_exists($submit_callback) ? array($submit_callback, 'islandora_ingest_form_submit') : array('islandora_ingest_form_submit');
$submit = function_exists($submit_callback) ? array(
$submit_callback,
'islandora_ingest_form_pre_submit',
'islandora_ingest_form_submit',
) : array('islandora_ingest_form_pre_submit', 'islandora_ingest_form_submit');
return array(
'#type' => 'submit',
'#name' => 'ingest',

16
islandora.module

@ -1913,3 +1913,19 @@ function islandora_find_package($package_name) {
}
return $found && user_access('administer site configuration');
}
/**
* Helper function for ingest steps and batches.
*
* When batches within batches are triggered within ingest steps
* the submit handler becomes out of scope. When it becomes time to execute the
* submit the function cannot be found and fails. This pre-submit is to
* get around this problem.
*
* @see https://www.drupal.org/node/2300367
*
* @see https://www.drupal.org/node/1300928
*/
function islandora_ingest_form_pre_submit($form, &$form_state) {
module_load_include('inc', 'islandora', 'includes/ingest.form');
}

Loading…
Cancel
Save