[Bug 32949] New: Smart-rules prefils junk date on page load
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Bug ID: 32949 Summary: Smart-rules prefils junk date on page load Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: System Administration Assignee: stalkernoid@gmail.com Reporter: stalkernoid@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- What is a junk date? How do you reproduce this bug? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Peter Vashchuk <stalkernoid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 --- Comment #2 from Peter Vashchuk <stalkernoid@gmail.com> --- Created attachment 146584 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146584&action=edit Bug 32949: Do not fill form with wrong shadow value to avoid data loss in smart-rules.tt When you edit the rule without initializing flatpickr plugin, if you press the save button it will overwrite the date with an empty value, making you lose the dates. This happens because flatpickr plugin's shadow value is not loaded if it's not initialized with a click on that date field. This patch fixes it. 1st Code commit text: To reproduce: 1. Head over to the smart rules admin page and create/use existing rule for certain item type/category. 2. Set "hard due date" and "No automatic renewal after (hard limit)" of that rule to a certain date and save. 3. Edit that same rule again, but this time just save it without any changes. The data for hard due date and hard limit will get lost and will be set as "None defined". 4. Apply the patch. 5. Repeat steps 2 and 3. Ensure that the data loss is not happening anymore. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 --- Comment #3 from Peter Vashchuk <stalkernoid@gmail.com> --- (In reply to Owen Leonard from comment #1)
What is a junk date? How do you reproduce this bug?
Hey Owen, I already had a fix for it, was meant to push it asap after I created this bug, please see the patch and description of it for more info. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146584|0 |1 is obsolete| | --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 146587 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146587&action=edit Bug 32949: Do not fill form with wrong shadow value to avoid data loss in smart-rules.tt When you edit the rule without initializing flatpickr plugin, if you press the save button it will overwrite the date with an empty value, making you lose the dates. This happens because flatpickr plugin's shadow value is not loaded if it's not initialized with a click on that date field. This patch fixes it. 1st Code commit text: To reproduce: 1. Head over to the smart rules admin page and create/use existing rule for certain item type/category. 2. Set "hard due date" and "No automatic renewal after (hard limit)" of that rule to a certain date and save. 3. Edit that same rule again, but this time just save it without any changes. The data for hard due date and hard limit will get lost and will be set as "None defined". 4. Apply the patch. 5. Repeat steps 2 and 3. Ensure that the data loss is not happening anymore. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Smart-rules prefils junk |Smart-rules prefills junk |date on page load |date on page load Status|Signed Off |Failed QA --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I don't have the patch applied, but I can't reproduce the issue. I also tried using another date format, but it all behaves nicely: * Set dateformat to DD.MM.YYYY * Create a circulation rule ALL-ALL-Books, with 21.2.2023 as hard due date and auto-renewal before. * Save rule. * Edit rule and save without changes. * Edit rule again - dates are still correct. Tested on master as of today. Also with the standard format MM.DD.YYYY. Can you please have a look? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 --- Comment #6 from Peter Vashchuk <stalkernoid@gmail.com> --- It doesn't seem to be working properly after the introduction of input id's, I will post a fix shortly :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Peter Vashchuk <stalkernoid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Peter Vashchuk <stalkernoid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146587|0 |1 is obsolete| | --- Comment #7 from Peter Vashchuk <stalkernoid@gmail.com> --- Created attachment 177678 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177678&action=edit Bug 32949: Fix wrong input id The input id was wrong, so instead "else" was handling the flatpickr data as plain text, which prefilled junk data and therefore resetting value of "Hard due date" field to "None defined". To reproduce: 1. Head over to the smart rules admin page and create/use existing rule for certain item type/category. 2. Set "hard due date" that rule to a certain date and save. 3. Edit that same rule again, but this time save it without any changes. Do not click or interact with flatpickr field. Date for hard due date will get lost and will be set as "None defined". 4. Apply the patch. 5. Repeat steps 2 and 3. Ensure that the data loss is not happening anymore. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177678|0 |1 is obsolete| | --- Comment #8 from Magnus Enger <magnus@libriotech.no> --- Created attachment 177724 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177724&action=edit Bug 32949: Fix wrong input id The input id was wrong, so instead "else" was handling the flatpickr data as plain text, which prefilled junk data and therefore resetting value of "Hard due date" field to "None defined". To reproduce: 1. Head over to the smart rules admin page and create/use existing rule for certain item type/category. 2. Set "hard due date" that rule to a certain date and save. 3. Edit that same rule again, but this time save it without any changes. Do not click or interact with flatpickr field. Date for hard due date will get lost and will be set as "None defined". 4. Apply the patch. 5. Repeat steps 2 and 3. Ensure that the data loss is not happening anymore. Signed-off-by: Magnus Enger <magnus@libriotech.no> Followed test plan, works as advertised. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177724|0 |1 is obsolete| | --- Comment #9 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 177925 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177925&action=edit Bug 32949: Fix wrong input id The input id was wrong, so instead "else" was handling the flatpickr data as plain text, which prefilled junk data and therefore resetting value of "Hard due date" field to "None defined". To reproduce: 1. Head over to the smart rules admin page and create/use existing rule for certain item type/category. 2. Set "hard due date" that rule to a certain date and save. 3. Edit that same rule again, but this time save it without any changes. Do not click or interact with flatpickr field. Date for hard due date will get lost and will be set as "None defined". 4. Apply the patch. 5. Repeat steps 2 and 3. Ensure that the data loss is not happening anymore. Signed-off-by: Magnus Enger <magnus@libriotech.no> Followed test plan, works as advertised. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |Main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com Version(s)|25.05.00 |25.05.00,24.11.08 released in| | --- Comment #11 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Pushed into 24.11.x for 24.11.08 nice work everyone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32949 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #12 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org