Browse Source

Merge pull request #473 from adam-vessey/7.x-USDA-41

Make the "undo_function" bit optional.
pull/477/head
Jordan Dukart 11 years ago
parent
commit
9a5c19be57
  1. 2
      includes/ingest.form.inc
  2. 6
      islandora.api.php

2
includes/ingest.form.inc

@ -467,12 +467,14 @@ function islandora_ingest_form_undo_consecutive_callback_steps(array $form, arra
* The step which the undo callback is being called on.
*/
function islandora_ingest_form_undo_callback_step(array $form, array &$form_state, array $step) {
if (isset($step['undo_function'])) {
$args = array(&$form_state);
$args = isset($step['undo_function']['args']) ? array_merge($args, $step['undo_function']['args']) : $args;
if (isset($step['undo_function']['file'])) {
require_once drupal_get_path('module', $step['module']) . "/" . $step['undo_function']['file'];
}
call_user_func_array($step['undo_function']['function'], $args);
}
}
/**

6
islandora.api.php

@ -423,13 +423,13 @@ function hook_islandora_undeletable_datastreams(array $models) {
* - form_id: The form building function to call to get the form structure
* for this step.
* - args: An array of arguments to pass to the form building function.
* Required "callback" type specific parameters:
* - do_function: An associate array including:
* "Callback" type specific parameters:
* - do_function: A required associative array including:
* - 'function': The callback function to be called.
* - 'args': An array of arguments to pass to the callback function.
* - 'file': A file to include (relative to the module's path, including
* the file's extension).
* - undo_function: An associate array including:
* - undo_function: An optional associative array including:
* - 'function': The callback function to be called to reverse the
* executed action in the ingest steps.
* - 'args': An array of arguments to pass to the callback function.

Loading…
Cancel
Save