[Koha-bugs] [Bug 30482] Potential for bad string concatenation in cataloging validation error message

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 7 11:53:19 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30482

--- Comment #3 from Owen Leonard <oleonard at myacpl.org> ---
Created attachment 133062
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133062&action=edit
Bug 30482: Potential for bad string concatenation in cataloging validation
error message

In validating the basic MARC editor form before submission, we run
AreFieldsNotOk() twice (once with the parameter "false") and concatenate
the result for output. This creates the potential for the error string
to be appended with "0" if AreFieldsNotOk() returns false.

This patch improves the logic around building the error string.

To test, apply the patch and make sure one of your MARC frameworks
contains at least one mandatory field and at least one important field.

- Edit or create a MARC record in the basic MARC editor.
- Submit the form in various states of completion:
  - If a mandatory and an important field are empty, you should see two
    error messages at the top. "The following mandatory subfields aren't
    filled" and "The following important subfields aren’t filled."
  - If a mandatory OR an important field is empty, you should see a
    single message.
    - If it's the important field which is empty, a confirmation will
      ask if you want to save the record anyway. Test that both answers
      to this confirmation work correctly.
  - If no mandatory or important fields are empty the form should
    submit.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list