From b4737ed80260ba98098c1a03eb0c1e144ca9c17e Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Fri, 28 Oct 2011 16:26:15 -0300 Subject: [PATCH] Fixed problem with page redirects on Edit --- ObjectHelper.inc | 1 + api/fedora_utils.inc | 1 + fedora_repository.module | 4 ++-- plugins/FedoraObjectDetailedContent.inc | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 8321c0ea..9567fd70 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -546,6 +546,7 @@ class ObjectHelper { */ function get_content_models_list($pid, $include_fedora_system_content_models = FALSE) { module_load_include('inc', 'fedora_repository', 'CollectionClass'); + module_load_include('inc', 'fedora_repository', 'ContentModel'); $collectionHelper = new CollectionClass(); $pids = array(); $query = 'select $object from <#ri> diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index c154dbc4..9399356d 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -235,6 +235,7 @@ function fix_dsid($dsid) { */ function get_collections_as_option_array() { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); + $restricted = variable_get('fedora_namespace_restriction_enforced', TRUE); $query = 'select $object $title from <#ri> where ($object $title and $object diff --git a/fedora_repository.module b/fedora_repository.module index f0ca2eaf..27060dda 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -317,7 +317,7 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer = NUL if (!empty($collectionPid)) { $collectionPid = $_SESSION['fedora_collection']; } -//$form['#redirect'] = $referrer; +//$form['#rebuild'] = $false; return $form; } @@ -989,7 +989,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU $obj = new FedoraObjectDetailedContent($pid); $object_details = $obj->showFieldSets(); if ($object_details['fedora_object_details']['#selected'] == TRUE) { - foreach ($cmodels_tabs as $cmodel_tab) { + foreach ($cmodels_tabs as &$cmodel_tab) { if (is_array($cmodel_tab)) { $cmodel_tab['#selected'] = FALSE; } diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 4f3d9a74..0eef0f75 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -39,11 +39,11 @@ class FedoraObjectDetailedContent { $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form'); $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_form'); $purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path())))); - + $details_selected = ($show_purge_tab ||$show_edit_tab); $tabset['fedora_object_details'] = array( '#type' => 'tabpage', '#title' => t('Object Details'), - '#selected' => $show_purge_tab, + '#selected' => $details_selected, ); $tabset['fedora_object_details']['tabset'] = array( '#type' => 'tabset',