Browse Source

Merge pull request #179 from willtp87/fix_ahah_submission_check

trying to not send notcies when checking for ahah_submission
pull/185/merge
Jonathan Green 12 years ago
parent
commit
65de1235f9
  1. 8
      fedora_repository.module

8
fedora_repository.module

@ -123,11 +123,12 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label
*/ */
function fedora_repository_ingest_form_submit(array $form, array &$form_state) { function fedora_repository_ingest_form_submit(array $form, array &$form_state) {
// Only validate the form if the submit button was pressed (other buttons may be used for AHAH. // Only validate the form if the submit button was pressed (other buttons may be used for AHAH.
if ($form_state['ahah_submission']) { if (array_key_exists('ahah_submission', $form_state) && $form_state['ahah_submission']) {
$form_state['submitted'] = FALSE; $form_state['submitted'] = FALSE;
return; return;
} }
if ($form_state['storage']['xml'] && module_exists('islandora_content_model_forms')) { if ($form_state['storage']['xml'] && module_exists('islandora_content_model_forms')) {
module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm'); module_load_include('inc', 'islandora_content_model_forms', 'IngestObjectMetadataForm');
$xml_form = new IngestObjectMetadataForm(); $xml_form = new IngestObjectMetadataForm();
@ -183,11 +184,12 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) {
*/ */
function fedora_repository_ingest_form_validate($form, &$form_state) { function fedora_repository_ingest_form_validate($form, &$form_state) {
// Only validate the form if the submit button was pressed (other buttons may be used for AHAH. // Only validate the form if the submit button was pressed (other buttons may be used for AHAH.
if ($form_state['ahah_submission']) { $is_ahah_submission = (array_key_exists('ahah_submission', $form_state) && $form_state['ahah_submission']);
if ($is_ahah_submission) {
$form_state['submitted'] = FALSE; $form_state['submitted'] = FALSE;
return; return;
} }
if (strpos($form_state['clicked_button']['#id'], 'edit-submit') === 0 && $form_state['ahah_submission'] != 1) { if (strpos($form_state['clicked_button']['#id'], 'edit-submit') === 0 && !$is_ahah_submission) {
switch ($form_state['storage']['step']) { switch ($form_state['storage']['step']) {
case 1: case 1:
$form_state['storage']['step']++; $form_state['storage']['step']++;

Loading…
Cancel
Save