Summary: | Unable to save item if field date acquired is set mandatory | ||
---|---|---|---|
Product: | Koha | Reporter: | Lari Taskula <lari.taskula> |
Component: | Cataloging | Assignee: | Lari Taskula <lari.taskula> |
Status: | CLOSED FIXED | QA Contact: | Joonas Kylmälä <joonas.kylmala> |
Severity: | normal | ||
Priority: | P5 - low | CC: | andrew, johanna.raisa, jonathan.druart, joonas.kylmala, kyle, m.de.rooy |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.05.00,21.11.05
|
|
Circulation function: | |||
Attachments: |
Bug 30376: Fix missing mandatory date acquired error on item save
Bug 30376: Fix missing mandatory date acquired error on item save Bug 30376: [ALTERNATIVE PATCH] Fix missing mandatory date acquired error on item save Bug 30376: [ALTERNATIVE PATCH] Fix missing mandatory date acquired error on item save Bug 30376: Fix missing mandatory date acquired error on item save |
Description
Lari Taskula
2022-03-28 10:32:00 UTC
Created attachment 132317 [details] [review] Bug 30376: Fix missing mandatory date acquired error on item save If you set 952$d (date acquired or "dateaccessioned") as mandatory in your MARC framework, you'll be unable to edit or add items because item form validation fails with error "1 mandatory fields empty". To test: 1. Edit a MARC framework of your choice (e.g. Default) 2. Locate 952$d "Date acquired" and click Edit /cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&tagfield=952&frameworkcode=#subdfield 3. Tick "Mandatory" checkbox 4. Save changes 5. Edit any item using MARC framework you edited in step 1 /cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=123&itemnumber=456 6. Set "Date acquired" to any date 7. Click Save 8. Observe error "- 1 mandatory fields empty (highlighted)" (JavaScript alert) 9. Apply patch 10. Repeat steps 5-7 11. Observe no error, item saves as expected Created attachment 132985 [details] [review] Bug 30376: Fix missing mandatory date acquired error on item save If you set 952$d (date acquired or "dateaccessioned") as mandatory in your MARC framework, you'll be unable to edit or add items because item form validation fails with error "1 mandatory fields empty". To test: 1. Edit a MARC framework of your choice (e.g. Default) 2. Locate 952$d "Date acquired" and click Edit /cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&tagfield=952&frameworkcode=#subdfield 3. Tick "Mandatory" checkbox 4. Save changes 5. Edit any item using MARC framework you edited in step 1 /cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=123&itemnumber=456 6. Set "Date acquired" to any date 7. Click Save 8. Observe error "- 1 mandatory fields empty (highlighted)" (JavaScript alert) 9. Apply patch 10. Repeat steps 5-7 11. Observe no error, item saves as expected Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com> This patch does not work for me, I get an error in the console Uncaught ReferenceError: flatpick_editor is not defined Well, the patch is actually working if you follow your test plan, but you forgot a regression step: don't fill in a date and expect the alert. Created attachment 133043 [details] [review] Bug 30376: [ALTERNATIVE PATCH] Fix missing mandatory date acquired error on item save This patch seems to work as expected. Please confirm. Created attachment 133054 [details] [review] Bug 30376: [ALTERNATIVE PATCH] Fix missing mandatory date acquired error on item save Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com> This alternative patch works better. After testing the first patch more there was a problem of saving mandatory fields, it allowed to save all empty mandatory fields. Created attachment 133134 [details] [review] Bug 30376: Fix missing mandatory date acquired error on item save Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Passing QA Pushed to master for 22.05, thanks to everybody involved [U+1F984] Unable to replicate bug in 21.11.x. If I am mistaken please let me know! (In reply to Kyle M Hall from comment #11) > Unable to replicate bug in 21.11.x. If I am mistaken please let me know! I tested on 21.11.x and the bug was also in it. (In reply to Johanna Räisä from comment #12) > (In reply to Kyle M Hall from comment #11) > > Unable to replicate bug in 21.11.x. If I am mistaken please let me know! > > I tested on 21.11.x and the bug was also in it. Thanks for the confirmation! I'll get this backported. Pushed to 21.11.x for 21.11.05 Unable to recreate on 21.05. Not backporting. |