Bug 29499 - CheckMandatorySubfields don't work properly with select field in serials-edit.tt
Summary: CheckMandatorySubfields don't work properly with select field in serials-edit.tt
Status: RESOLVED DUPLICATE of bug 29496
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-17 09:56 UTC by Marion Durand
Modified: 2021-11-18 10:18 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29499: CheckMandatorySubfields don't work properly with select field in serials-edit.tt (2.88 KB, patch)
2021-11-17 10:21 UTC, Marion Durand
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marion Durand 2021-11-17 09:56:58 UTC
Since one of the patches of Bug 27526 (Bug 27526: Fix mandatory and important checks), CheckMandatorySubfields use the class "input_marceditor" but in the file serials-edit.tt this class is not set for all field (it is present on text input but not on select input). 

In consequence if a select field is set as mandatory, it is detected as missing even if it is filed and so you can't submit the form and receive the new serial.

Test plan:
0- Be sure to be in a version of koha where the patch that introduces the bug is present (it is present in master since Jul 8 2021 (it is present in 21.06.00.046) and will be pushed in 21.11.00)
1- Create (or find) a subscription for a biblio record and select the option "Create an item record when receiving this serial"
2- Be sure to have at least one mandatory subfield that is filed with a select input in the framework used by the biblio record. (ex: 995$b, 995$c or 995$e in unimarc; 952$a, 952$b or 952$c in marc21)
3- From the subscription-detail page click on "Receive"
4- Change the status to "Arrived" and fill the item form that appears.
5- Click on "Save" and check that an error box appear with the message " Form not submitted because of the following problem(s) 1 mandatory fields empty (highlighted)" (the number can be different according to the number of concerned subfields)
Comment 1 Marion Durand 2021-11-17 10:21:33 UTC
Created attachment 127709 [details] [review]
Bug 29499: CheckMandatorySubfields don't work properly with select field in serials-edit.tt

Since one of the patches of BZ 27526 (Bug 27526: Fix mandatory and
important checks), CheckMandatorySubfields use the class
"input_marceditor" but in file serials-edit.tt this class is not set for
all field (it is present on text input but not on select input) 5
9- Check that no error appear and that your item has been created.

In consequence if a select field is set as mandatory, it is detected as
missing even if it is filed and so you can't submit the form and receive
the new serial.

Test plan:
0- Be sure to be in a version of koha where the patch that introduces
   the bug is present (it is present in master since Jul 8 2021 (it is
   present in 21.06.00.046) and will be pushed in 21.11.00)
1- Create (or find) a subscription for a biblio record and select the
   option "Create an item record when receiving this serial"
2- Be sure to have at least one mandatory subfield that is filed with a
   select input in the framework used by the biblio record. (ex: 995$b,
   995$c or 995$e in unimarc; 952$a, 952$b or 952$c in marc21)
3- From the subscription-detail page click on "Receive"
4- Change the status to "Arrived" and fill the item form that appears.
5- Click on "Save"
6- Check that an error box appear with the message " Form not submitted
   because of the following problem(s) 1 mandatory fields empty
   (highlighted)" (the number can be different according to the number of
   concerned subfields)
7- Apply the patch
8- Repeat step 3 to 5
9- Check that no error appear and that your item has been created
Comment 2 Jonathan Druart 2021-11-18 10:18:05 UTC
Hi Marion, the problem exists on other forms as well and I fixed it on bug 29496. Can you have a look at it please?
I will move your patch there and rebase mine on top of yours.

*** This bug has been marked as a duplicate of bug 29496 ***