Skip to content

Commit

Permalink
pkp/pkp-lib#7505 Review Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
defstat committed Nov 25, 2023
1 parent d28b4b3 commit 1dd56a1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions classes/ArticleFront.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ public function createJournalMeta(Journal $journal, PKPRequest $request): \DOMNo
->setAttribute('pub-type','ppub');
}

$dispatcher = new Dispatcher();
$dispatcher->setApplication(Application::get());
$dispatcher->addRouterName('\APP\core\PageRouter', PKPApplication::ROUTE_PAGE);
$router = $request->getRouter();
$dispatcher = $router->getDispatcher();

$journalUrl = $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $journal->getPath());
$journalMetaElement
Expand Down Expand Up @@ -204,7 +203,7 @@ function createArticleMeta(Submission $submission, Journal $journal, Section $se
}

// Include pub dates
if ($datePublished){
if ($datePublished) {
$pubDateElement = $articleMetaElement->appendChild($this->createElement('pub-date'))
->setAttribute('date-type', 'pub')->parentNode
->setAttribute('publication-format','epub')->parentNode;
Expand All @@ -217,8 +216,6 @@ function createArticleMeta(Submission $submission, Journal $journal, Section $se

$pubDateElement->appendChild($this->createElement('year'))
->appendChild($this->createTextNode(strftime('%Y', (int)$datePublished)));
} else {
$pubDateElement = $articleMetaElement->appendChild($this->createElement('pub-date-not-available'));
}

// Include page info, if available and parseable.
Expand Down Expand Up @@ -281,9 +278,9 @@ function createArticleMeta(Submission $submission, Journal $journal, Section $se
}
}

$dispatcher = new Dispatcher();
$dispatcher->setApplication(Application::get());
$dispatcher->addRouterName('\APP\core\PageRouter', PKPApplication::ROUTE_PAGE);
$router = $request->getRouter();
$dispatcher = $router->getDispatcher();

$url = $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $journal->getPath(), 'article', 'view', $submission->getBestId(), null, null, true);

$articleMetaElement
Expand Down

0 comments on commit 1dd56a1

Please sign in to comment.