Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions filter/ArticleCrossrefXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
use PKP\db\DAORegistry;
use PKP\filter\FilterGroup;
use PKP\i18n\LocaleConversion;
use PKP\submission\GenreDAO;
use PKP\submission\genre\Genre;
;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
;


class ArticleCrossrefXmlFilter extends IssueCrossrefXmlFilter
{
Expand Down Expand Up @@ -263,18 +264,14 @@ public function createJournalArticleNode(DOMDocument $doc, Publication $publicat
$pdfGalleyInArticleLocale = null;
// Also collect supplementary files with DOIs for the component list
$componentGalleys = [];
$genreDao = DAORegistry::getDAO('GenreDAO'); /** @var GenreDAO $genreDao */
foreach ($galleys as $galley) {
// Only include supplementary files that have a DOI
if (!$galley->getData('urlRemote')) {
$galleyFile = $galley->getFile();
if ($galleyFile) {
$genre = $genreDao->getById($galleyFile->getGenreId());
if ($genre->getSupplementary()) {
if ($galley->getDoi()) {
// construct the array key with galley best ID and locale needed for the component node
$componentGalleys[] = $galley;
}
$genre = Genre::findById((int) $galleyFile->getGenreId());
if ($genre !== null && $genre->supplementary && $galley->getDoi()) {
$componentGalleys[] = $galley;
} else {
$submissionGalleys[] = $galley;
if ($galley->isPdfGalley()) {
Expand Down