Skip to content

Commit

Permalink
pkp/pkp-lib#9497 Since forms are retrieved from individual endpoints,…
Browse files Browse the repository at this point in the history
… addJavascript needs to be called when loading editors.tpl
  • Loading branch information
jardakotesovec authored and bozana committed Jan 15, 2025
1 parent d3c8e9f commit 6aa05ec
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugins/pubIds/urn/URNPubIdPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,6 @@ public function addPublicationFormFields(string $hookName, FormComponent $form):

$appyCheckNumber = $this->getSetting($form->submissionContext->getId(), 'urnCheckNo');

if ($appyCheckNumber) {
// Load the checkNumber.js file that is required for URN fields
$this->addJavaScript(Application::get()->getRequest(), TemplateManager::getManager(Application::get()->getRequest()));
}
// If a pattern exists, use a DOI-like field to generate the URN
if ($pattern) {
$fieldData = [
Expand Down Expand Up @@ -476,6 +472,14 @@ public function loadUrnFieldComponent(string $hookName, array $args): void

$context = Application::get()->getRequest()->getContext();
$suffixType = $this->getSetting($context->getId(), 'urnSuffix');

$appyCheckNumber = $this->getSetting($context->getId(), 'urnCheckNo');

if ($appyCheckNumber) {
// Load the checkNumber.js file that is required for URN fields
$this->addJavaScript(Application::get()->getRequest(), TemplateManager::getManager(Application::get()->getRequest()));
}

if ($suffixType === 'default' || $suffixType === 'pattern') {
$templateMgr->addJavaScript(
'field-pub-id-urn-component',
Expand Down

0 comments on commit 6aa05ec

Please sign in to comment.