Skip to content

Commit

Permalink
pkp/pkp-lib#2072 Fix fatal error with book landing page templates
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr committed Sep 5, 2019
1 parent 634ac4a commit 0b8673e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions pages/catalog/CatalogBookHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ function book($args, $request) {
'ccLicenseBadge' => Application::getCCLicenseBadge($submission->getLicenseURL())
));

// Categories
$templateMgr->assign([
'categories' => DAORegistry::getDAO('CategoryDAO')->getByPublicationId($submission->getCurrentPublication()->getId())->toArray(),
]);

// Keywords
$submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO');
$templateMgr->assign('keywords', $submissionKeywordDao->getKeywords($submission->getId(), array(AppLocale::getLocale())));
Expand Down
9 changes: 4 additions & 5 deletions templates/frontend/objects/monograph_full.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
{if $citations}
{foreach from=$citations item=$citation}
<p>{$citation->getCitationWithLinks()|strip_unsafe_html}</p>
{/iterate}
{/foreach}
{else}
{$monograph->getCurrentPublication()->getData('citationsRaw')|nl2br}
{/if}
Expand Down Expand Up @@ -430,21 +430,20 @@
{/if}

{* Categories *}
{assign var=categories value=$monograph->getCategories()}
{if !$categories->wasEmpty()}
{if $categories}
<div class="item categories">
<div class="label">
{translate key="catalog.categories"}
</div>
<div class="value">
<ul>
{iterate from=categories item=category}
{foreach from=$categories item="category"}
<li>
<a href="{url op="category" path=$category->getPath()}">
{$category->getLocalizedTitle()|strip_unsafe_html}
</a>
</li>
{/iterate}
{/foreach}
</ul>
</div>
</div>
Expand Down

0 comments on commit 0b8673e

Please sign in to comment.