From bbccdc554b627a21e6c74c4a2ff8d67e720706f6 Mon Sep 17 00:00:00 2001 From: Anvit Srivastav Date: Fri, 31 Jan 2025 14:11:41 -0800 Subject: [PATCH] Fix DO images in the edit DO page (#1915) Using a div with appropriate styling classes instead of a section for the image in the edit DO page header since blank.js filters/removes any sections that do not have content meant for sections. Also updating the resource sent to the QubitAcl check to point to the parents' object instead of the resources' object in the scenario when that object is empty. --- .../digitalobject/actions/showComponent.class.php | 12 ++++++++++-- .../modules/digitalobject/templates/editSuccess.php | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/qubit/modules/digitalobject/actions/showComponent.class.php b/apps/qubit/modules/digitalobject/actions/showComponent.class.php index 029c523793..8fe4fd3d4e 100644 --- a/apps/qubit/modules/digitalobject/actions/showComponent.class.php +++ b/apps/qubit/modules/digitalobject/actions/showComponent.class.php @@ -74,12 +74,20 @@ public function execute($request) */ private function checkShowGenericIcon() { + $resourceObject = $this->resource->object; + + // Get the parent resouce (IO or Actor) for Acl check + // if resource->object is empty and parent exists + if (!$resourceObject && $this->resouce->parent) { + $resourceObject = $this->resource->parent->object; + } + switch ($this->usageType) { case QubitTerm::REFERENCE_ID: - return !QubitAcl::check($this->resource->object, 'readReference'); + return !QubitAcl::check($resourceObject, 'readReference'); case QubitTerm::THUMBNAIL_ID: - return !QubitAcl::check($this->resource->object, 'readThumbnail'); + return !QubitAcl::check($resourceObject, 'readThumbnail'); } } diff --git a/plugins/arDominionB5Plugin/modules/digitalobject/templates/editSuccess.php b/plugins/arDominionB5Plugin/modules/digitalobject/templates/editSuccess.php index 7c8b07f828..af17957e11 100644 --- a/plugins/arDominionB5Plugin/modules/digitalobject/templates/editSuccess.php +++ b/plugins/arDominionB5Plugin/modules/digitalobject/templates/editSuccess.php @@ -23,9 +23,9 @@ renderHiddenFields(); ?> -
+
$resource, 'usageType' => QubitTerm::REFERENCE_ID]); ?> -
+