File is required Review Form

When trying to confirm a review, I get validated fields that are not mandatory on the form, so I can’t send an email to the reviewer.

image

Hi @Karina_Leiva_Parra,

Which of our applications are you using, and what version? (Please include this information in your posts.)

Regards,
Alec Smecher
Public Knowledge Project Team

I’m sorry. I’m using OJS 3.0.2.

Thanks!

Hi @asmecher,

3.0.2.
I have the same issue and started to note it also in large text fields.

Thank you,
Best

Hello,

I think this is something in here that I’m looking into it:

ReviewerReviewStep3Form.inc.php

$this->addCheck(new FormValidatorCustom($this, ‘reviewFormResponses’, ‘required’, ‘reviewer.submission.reviewFormResponse.form.responseRequired’, create_function(’$reviewFormResponses, $requiredReviewFormElementIds’, ‘foreach ($requiredReviewFormElementIds as $requiredReviewFormElementId) { if (!isset($reviewFormResponses[$requiredReviewFormElementId]) || $reviewFormResponses[$requiredReviewFormElementId] == ‘’) return false; } return true;’), array($requiredReviewFormElementIds)));

Thank you,
Best regards

Hi @digitojs,

Were you able to confirm e.g. whether removing that line results in the Required flags being ignored?

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher,

removed that line but stays the same, it doesn’t ignore the empty fields.
Could it be assigning the fields as required in other place?

Thank you!
Best regards

Hi @digitojs,

Try applying this change: Fix readonly/disabled thinko · pkp/pkp-lib@6cec153 · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thank you for your reply.
That line has already that change, only TYPE_SMALL_TEXT_FIELD, TYPE_TEXT_FIELD, TYPE_TEXTAREA have readonly=$disabled, but I had also tried to change and test those fields and nothing. The TYPE_SMALL_TEXT_FIELD, TYPE_TEXT_FIELD work fine, only TYPE_TEXTAREA complains about being required when it is not.

Thank you!
Best regards

Hello,

In inspector, for a texta area not required:

<textarea required="0" class=" " name="reviewFormResponses[310]" rows="4" cols="40" id="reviewFormResponses-310-59c250d82b07e"></textarea>

for a normal text field not required:

<input translate="" 0="" class="field text" name="reviewFormResponses[312]" value="" id="reviewFormResponses-312-59c250d82f0b1" type="text">

I don’t get why only textarea gets 0 or 1 for required (I checked all the other elements), or how some check is not made.

Best regards

Hello,

From what I tested the required flag won’'t work because of the type textarea. If it has the required atribute, it considers as required and don’t apply the flag. And being a “comment” type of input, maybe it could be always not required, it makes sense in a review form, but of course there could be some other journal with a different perspective of this.
I need to proceed with this but with your insight and changing the right code.

Thank you,
Best regards

Hello everyone,

Found a previous issue that considered this problem: [OJS] Formbuildervocabulary does not consider required param for textareas · Issue #2418 · pkp/pkp-lib · GitHub
It is solved!

Thank you,
Best regards

Hi @digitojs,

Ah, good spotting! Glad to hear it’s resolved. (I had a hunch I’d already worked with this issue but couldn’t find it.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Although it solved that issue, for select, like checkboxes, the required message isn’t displayed.

Thank you,
Best regards

Hello,

When fields, in this case checkboxes, aren’t selected the revision loads the formerrors page and it doesn’t display the correct locales/keys/text. Until now didn’t notice this was happening!

Thank you,
Best regards

Hi @digitojs,

I’m not sure I’m following – could you describe in more detail?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Lets suppose we have a review form with all type of fields: text, radio buttons, checkboxes, etc.
When the reviewer is filling the form to submit, and if a required field is empty, it doesnt send the form and display the required field message in each question. If only required checkboxes aren’t answered, it delivers error but not in the same way as it behaves with the other type of fields. It loads formError.tpl and some keys are not translated (##key.to.translate## format). And each time a user tries to submit the form in this stage, without answering the checkboxes, it adds the final

* required field.

Did it make sense, @asmecher?

Thank you!
Best regards

Hi @digitojs,

Thanks, that makes sense. I’ve filed this for attention at Correct review form error handling bounce issues · Issue #2814 · pkp/pkp-lib · GitHub and will resolve each issue separately.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thank you for your reply.
I have corrected the issue partially as your commit exposed too, but the bounce (the perfect expression for this) of each time the formError is loaded, and adds the final *required field, is slipping me.

Thank you for your time,
Best regards

Hi @digitojs,

Try removing your template cache files – they’re in cache/t_compile/. You should be able to remove all .php files there and they’ll be regenerated as needed.

Regards,
Alec Smecher
Public Knowledge Project Team