Skip to content

Commit

Permalink
Fixed display of public button in resource page when module IIIF Serv…
Browse files Browse the repository at this point in the history
…er is not used.
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Jan 23, 2023
1 parent b0f1865 commit 6f74bee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ public function handleViewLayoutResource(Event $event): void
return;
}

/** @var \Omeka\Api\Representation\AbstractResourceEntityRepresentation $resource */
$vars = $view->vars();
if ($vars->offsetExists('resource')) {
$resource = $vars->offsetGet('resource');
Expand All @@ -309,7 +310,7 @@ public function handleViewLayoutResource(Event $event): void
return;
}

$url = $view->publicResourceUrl($resource);
$url = $resource->siteUrl($defaultSiteSlug);
if (!$url) {
return;
}
Expand Down

0 comments on commit 6f74bee

Please sign in to comment.