From ca586da81df34e65093826f6d6be81cb874c2a01 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 20 Jan 2011 14:05:20 -0400 Subject: [PATCH 1/2] Made optional in purge form. --- fedora_repository.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index c67ca207..fd2f14b1 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -234,7 +234,7 @@ function fedora_repository_ingest_form(&$form_state, $collection_pid, $collectio return $ingestForm->createIngestForm($collection_pid, $collection_label, $form_state); } -function fedora_repository_purge_object_form(&$form_state, $pid, $referrer) { +function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NULL) { global $base_url; // $form['#redirect'] = "fedora/repository/$collectionPid/"; $form['pid'] = array( From 2128d2d23c135ed46bad9480fe470827c284deba Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 20 Jan 2011 14:36:21 -0400 Subject: [PATCH 2/2] Updated tests to deal wiht purge object confirm form. --- fedora_repository.module | 7 +++---- tests/fedora_repository.test | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index fd2f14b1..818fc4ac 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -430,13 +430,12 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { } return; } - if (empty($collectionPid) && $_SESSION['fedora_collection'] != $pid) { - $collectionPid = $_SESSION['fedora_collection']; - } if (!empty($form_state['values']['referrer'])) { $form_state['redirect'] = $form_state['values']['referrer']; } - else { + elseif (empty($collectionPid) && $_SESSION['fedora_collection'] != $pid) { + $collectionPid = $_SESSION['fedora_collection']; + $form_state['redirect'] = "fedora/repository/$collectionPid/"; } } diff --git a/tests/fedora_repository.test b/tests/fedora_repository.test index 216ff4e7..3eb6226e 100644 --- a/tests/fedora_repository.test +++ b/tests/fedora_repository.test @@ -103,6 +103,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $this->pass("This is the PID list to purge: ". implode(", ", $pid_list) ); foreach ($pid_list as $pid) { $this->drupalPost("fedora/repository/purgeObject/$pid", array(), 'Purge'); + $this->drupalPost(NULL, array(), 'Delete'); } }