From 2371ea7869f07ab929d2fe7b60dfa1b3680726f9 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Tue, 19 Jun 2012 09:39:57 -0300 Subject: [PATCH 1/2] Use function to get query. --- CollectionClass.inc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CollectionClass.inc b/CollectionClass.inc index e1ec846e..0e518b6d 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -533,16 +533,12 @@ class CollectionClass { function showFieldSets($page_number) { module_load_include('inc', 'fedora_repository', 'api/fedora_item'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); - //module_load_include('inc', 'fedora_repository', 'BatchIngest'); //Legacy code? global $base_url; global $user; $tabset = array(); - $query = NULL; + $query = self::getCollectionQuery($this->pid); $item = new Fedora_Item($this->pid); - if ($item->exists() && array_key_exists('QUERY', $item->datastreams)) { - $query = $item->get_datastream_dissemination('QUERY'); - } $results = $this->getRelatedItems($this->pid, $query); $collection_items = $this->renderCollection($results, $this->pid, NULL, NULL, $page_number); From 0b8ef2ecd990281d565dd637e0468920c722d863 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Wed, 20 Jun 2012 20:37:48 +0200 Subject: [PATCH 2/2] Fixed where I missed avoiding the page cache for datastreams. --- fedora_repository.module | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fedora_repository.module b/fedora_repository.module index a4f337e9..747eb204 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -948,7 +948,7 @@ function makeObject($pid, $dsID) { drupal_set_message(t("No pid or dsid given to create an object with.")); return ' '; } - global $user; + global $user, $conf; if (!fedora_repository_access(OBJECTHELPER :: $OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { drupal_access_denied(); return; @@ -956,6 +956,9 @@ function makeObject($pid, $dsID) { return ' '; } + //Disable the page cache, so entire datastreams do not get thrown into the page cache. + $conf['cache'] = CACHE_DISABLED; + module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $objectHelper = new ObjectHelper(); $objectHelper->makeObject($pid, $dsID);