From 967fcce4487b0f2d5caa7313fb4140347b3f6cb9 Mon Sep 17 00:00:00 2001 From: William Panting Date: Tue, 16 Oct 2012 17:18:27 -0300 Subject: [PATCH] trying to not send notcies when checking for ahah_submission --- fedora_repository.module | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 1beb9b06..d794c20c 100644 --- a/fedora_repository.module +++ b/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) { // 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; return; } + if ($form_state['storage']['xml'] && module_exists('islandora_content_model_forms')) { module_load_include('inc', 'islandora_content_model_forms', '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) { // 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; 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']) { case 1: $form_state['storage']['step']++;