Mandatory fields, flags, submission OJS 3.0.2.0

I have to put that keywords and references are mandatory fields. Please instruct me how to do that.

Thanks

Hi @vvucic,

For the moment, that’ll require a template modification. See templates/submission/submissionMetadataFormFields.tpl.

Regards,
Alec Smecher
Public Knowledge Project Team

OK. Thanks. Are there any other interrelated files that should be edited too?

Thanks

Hi @vvucic,

The corresponding form is implemented in PHP in lib/pkp/classes/submission/PKPSubmissionMetadataFormImplementation.inc.php and classes/submission/.inc.php. (SubmissionMetadataFormImplementation extends PKPSubmissionMetadataFormImplementation – the former is the OJS-specific extension of the latter, which is used by both OJS and OMP.) PKPSubmissionMetadataFormImplementation has a function called addChecks that’s used to set up the required field checks on the server side.

Regards,
Alec Smecher
Public Knowledge Project Team

I am checking and editing those files but I do not get keywords and references marked with asterisk i.e mandatory.

If I put in /PKPSubmissionMetadataFormImplementation.inc.php this line after line 50
$this->_parentForm->addCheck(new FormValidatorLocale($this->_parentForm, ‘keyword’, ‘required’, ‘submission.submit.form.keywordRequired’));

I still do not get keywords mandatory
Please advise

Hi @vvucic,

The asterisk needs to be added by setting the required=true attribute in the {fbvElement ...} call that generates the field. You’ll find this in the template file.

Regards,
Alec Smecher
Public Knowledge Project Team

I defined that element like this in /templates/submission/submissionMetadataFormFields.tpl.:
{fbvElement type=“keyword” id=“languages” subLabelTranslate=true multilingual=true required=true current=$languages source=$languagesSourceUrl disabled=$readOnly}
and addedd in validation checks in lib/pkp/classes/submission/PKPSubmissionMetadataFormImplementation.inc.php
$this->_parentForm->addCheck(new FormValidatorLocale($this->_parentForm, ‘keyword’, ‘required’, ‘submission.submit.form.keywordRequired’))
I cleaned template cache but I still do not get it as mandatory.
What next I have to do? Do you define field for references as ‘references’ or with different name?
Thanks

Hello! @vvucic and @asmecher

For indexing processes (Scielo, Latindex, etc.) there are several requirements that are mandatory. For that reason I think it would be very useful to be able to modify the mandatory fields.

Further guidance is possible.

@vvucic, could you get the expected modification of the fields?

Any help will be greatly appreciated!

Hi @David_Alarcon_davidy,

Here is some related code that we just added during our code sprint.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thank you very much @asmecher ! 
 I will wait for version 3.1 to see how it works.

Have a nice day!

Hi. I want to disable last name mandatory option of contributor.