Skip to content

Commit

Permalink
Fix DO images in the edit DO page (#1915)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anvit committed Feb 4, 2025
1 parent 8cb8b88 commit 2378d48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions apps/qubit/modules/digitalobject/actions/showComponent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

<?php echo $form->renderHiddenFields(); ?>

<section id="content" class="border-bottom-0 rounded-0 rounded-top">
<div class="border border-bottom-0 rounded-0 rounded-top bg-white">
<?php echo get_component('digitalobject', 'show', ['resource' => $resource, 'usageType' => QubitTerm::REFERENCE_ID]); ?>
</section>
</div>

<div class="accordion mb-3">
<div class="accordion-item rounded-0">
Expand Down

0 comments on commit 2378d48

Please sign in to comment.