[Bug 43988] New: Setting an additional contents number/position to 0 isn't handled consistently
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 Bug ID: 43988 Summary: Setting an additional contents number/position to 0 isn't handled consistently Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: lisette@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- If you set a news item or other additional contents to appear in position 0, it saves as 0 and is sorted first. When you go to edit the news item it shows as blank and then saves as blank if you don't but anything in the field. Null shows at the end. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lisette@bywatersolutions.co |ity.org |m Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 --- Comment #1 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210294 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210294&action=edit Bug 43988: Store a 0 additional contents position as no position The edit form shows a 0 position as blank, but 0 was stored and sorted before 1, so a news item or other additional content saved with 0 was displayed first until it was saved again with the field blank. This patch: - Stores a blank or 0 position as NULL in Koha::AdditionalContent->store, so the content is displayed after the ones with a position, as the edit form shows it - Restricts the position field to digits (inputmode="numeric" and pattern="[0-9]*") so invalid values are caught in the browser To test: 1. Go to Tools -> News and add two news items for the staff interface, one with position 1 and one with position 0 2. Go to the staff interface home page, the item with position 0 is displayed first 3. Apply the patch and restart services 4. Edit the item with position 0 and save it without changing anything 5. Add a third item with position 0 6. Go to the staff interface home page, the items with position 0 are displayed after the item with position 1 7. Edit one of them, the position field is blank 8. Try saving a news item with letters or a negative number as position, the browser does not let you save it 9. prove t/db_dependent/Koha/AdditionalContents.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39538 Text to go in the| |This fixes an issue where a release notes| |position can be saved as 0, | |but then later shows as | |blank. | | | |The input for position is | |now numeric and 0 behaves | |the same as blank. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39538 [Bug 39538] Replace UserCSS system preference with snippets -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This fixes an issue where a |This fixes an issue where a release notes|position can be saved as 0, |position can be saved as 0, |but then later shows as |but then later shows as |blank. |blank. | | |The input for position is |The input for position is |now numeric and 0 behaves |now numeric and 0 behaves |the same as blank. |the same as blank. | | | |Additionally the input will | |not save negative numbers | |or non number characters. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210294|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 --- Comment #2 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 210362 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210362&action=edit Bug 43988: Store a 0 additional contents position as no position The edit form shows a 0 position as blank, but 0 was stored and sorted before 1, so a news item or other additional content saved with 0 was displayed first until it was saved again with the field blank. This patch: - Stores a blank or 0 position as NULL in Koha::AdditionalContent->store, so the content is displayed after the ones with a position, as the edit form shows it - Validates the position field as digits only (jQuery Validate "digits" rule), so letters and negative numbers cannot be saved To test: 1. Go to Tools -> News and add two news items for the staff interface, one with position 1 and one with position 0 2. Go to the staff interface home page, the item with position 0 is displayed first 3. Apply the patch and restart services 4. Edit the item with position 0 and save it without changing anything 5. Add a third item with position 0 6. Go to the staff interface home page, the items with position 0 are displayed after the item with position 1 7. Edit one of them, the position field is blank 8. Try saving a news item with letters or a negative number as position, the "Please enter only digits." message is displayed and it is not saved 9. prove t/db_dependent/Koha/AdditionalContents.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 Andrew Fuerste-Henry <andrew@bywatersolutions.com> 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=43988 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210362|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210408 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210408&action=edit Bug 43988: Store a 0 additional contents position as no position The edit form shows a 0 position as blank, but 0 was stored and sorted before 1, so a news item or other additional content saved with 0 was displayed first until it was saved again with the field blank. This patch: - Stores a blank or 0 position as NULL in Koha::AdditionalContent->store, so the content is displayed after the ones with a position, as the edit form shows it - Validates the position field as digits only (jQuery Validate "digits" rule), so letters and negative numbers cannot be saved To test: 1. Go to Tools -> News and add two news items for the staff interface, one with position 1 and one with position 0 2. Go to the staff interface home page, the item with position 0 is displayed first 3. Apply the patch and restart services 4. Edit the item with position 0 and save it without changing anything 5. Add a third item with position 0 6. Go to the staff interface home page, the items with position 0 are displayed after the item with position 1 7. Edit one of them, the position field is blank 8. Try saving a news item with letters or a negative number as position, the "Please enter only digits." message is displayed and it is not saved 9. prove t/db_dependent/Koha/AdditionalContents.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Barbara Johnson <Barbara.Johnson@bedfordtx.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43988 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |aleisha@catalyst.net.nz |y.org | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org