From 93ac3d8ed2ec6cc69375d66c514d5851a8a21615 Mon Sep 17 00:00:00 2001 From: Bozana Bokan Date: Fri, 8 Mar 2024 19:46:44 +0100 Subject: [PATCH] pkp/crossrefReferenceLinking#24 load pubIds category in CLI tool and scheduled task --- CrossrefReferenceLinkingInfoSender.inc.php | 2 ++ tools/checkCrossrefReferencesDOIs.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CrossrefReferenceLinkingInfoSender.inc.php b/CrossrefReferenceLinkingInfoSender.inc.php index 9911d41..d97e49e 100644 --- a/CrossrefReferenceLinkingInfoSender.inc.php +++ b/CrossrefReferenceLinkingInfoSender.inc.php @@ -54,6 +54,8 @@ function executeActions() { $journals = $this->_getJournals(); foreach ($journals as $journal) { + // load pubIds for this journal + PluginRegistry::loadCategory('pubIds', true, $journal->getId()); // Call the plugin register function, in order to be able to save the new article and citation settings in the DB $plugin->register('generic', $plugin->getPluginPath(), $journal->getId()); // Get published articles to check diff --git a/tools/checkCrossrefReferencesDOIs.php b/tools/checkCrossrefReferencesDOIs.php index dd08490..ee5e4cf 100644 --- a/tools/checkCrossrefReferencesDOIs.php +++ b/tools/checkCrossrefReferencesDOIs.php @@ -54,6 +54,8 @@ function execute() { case 'all': $contexts = $contextDao->getAll(); while ($context = $contexts->next()) { + // load pubIds for this journal + PluginRegistry::loadCategory('pubIds', true, $context->getId()); $plugin = PluginRegistry::loadPlugin('generic', 'crossrefReferenceLinking', $context->getId()); // Get published articles to check $submissionsToCheck = $plugin->getSubmissionsToCheck($context); @@ -69,6 +71,8 @@ function execute() { printf("Error: Skipping $contextId. Unknown context.\n"); continue; } + // load pubIds for this journal + PluginRegistry::loadCategory('pubIds', true, $context->getId()); $plugin = PluginRegistry::loadPlugin('generic', 'crossrefReferenceLinking', $context->getId()); // Get published articles to check $submissionsToCheck = $plugin->getSubmissionsToCheck($context); @@ -84,6 +88,8 @@ function execute() { printf("Error: Skipping $submissionId. Unknown submission.\n"); continue; } + // load pubIds for this journal + PluginRegistry::loadCategory('pubIds', true, $submission->getContextId()); $plugin = PluginRegistry::loadPlugin('generic', 'crossrefReferenceLinking', $submission->getContextId()); $plugin->getCrossrefReferencesDOIs($submission->getCurrentPublication()); }