OJS 3.3.0.11
We generate DOIs automatically and have implemented our own code for the plugin’s addPublicationFormFields
function. At the end we add a form field like this, similar to the default “no pattern” variant:
$form->addField(new \PKP\components\forms\FieldText('pub-id::doi', [
'label' => __('metadata.property.displayName.doi'),
'description' => __('plugins.pubIds.doi.manager.settings.doiSuffixRandomIdentifier'),
'value' => $generatedDOI,
]));
But the value is not displayed in the interface, we end up with an empty line edit.
In the browser’s network tools I see that the server sends the data correctly. The pkp.registry.init
Javascript Snippet contains:
"fields":[{"name":"pub-id::doi","component":"field-text","label":"DOI","description":"Mit dieser Option wird eine 8-stellige, zufallsgenerierte ID (bestehend aus Zahlen und Buchstaben) generiert.","groupId":"default","isRequired":false,"isMultilingual":false,"value":"10.34780\/s7e7-fdh6","inputType":"text","optIntoEdit":false,"optIntoEditLabel":"","size":"normal","prefix":""}
When I change the form’s id to something slightly different, the value gets displayed. For example:
$form->addField(new \PKP\components\forms\FieldText('pub-id::doi-variant', [
So it seems to me like the doi form element gets some special treatment, but I am unable to discern where exactly this behaviour is triggered.
I also tried the following:
$form->addField(new \PKP\components\forms\FieldText('pub-id::doi', [
'label' => __('metadata.property.displayName.doi'),
'description' => __('plugins.pubIds.doi.manager.settings.doiSuffixRandomIdentifier'),
'prefix' => $prefix,
'separator' => '/',
'value' => $generatedSuffix
]));
But again, the value
is not displayed, just the prefix as a read only part of the input field.
Can anyone point me in the right direction?