[Bug 42973] New: Additional contents ordering ignores "Appear in position" when sorting news
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42973 Bug ID: 42973 Summary: Additional contents ordering ignores "Appear in position" when sorting news Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: Laura.escamilla@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Bug 39027 changed the default ordering of news items to use the publication date (newest first). However, this change no longer respects the manual "Appear in position" value (additional_content.number). Previously, libraries could assign a position number to pin or manually order specific news items. After Bug 39027, news items are always ordered by publication date, regardless of whether a manual position has been assigned. To recreate: 1. Create two or more news items. 2. Assign an "Appear in position" value to one of the items (for example, 1). 3. Give another news item a more recent publication date. 4. View the news on the OPAC or staff interface. 5. Notice that the newer item is displayed first instead of the item with the assigned position. Expected behavior: If a news item has an "Appear in position" value, that value should take precedence over the default publication date ordering. News items without a manual position should continue to be ordered by publication date (newest first). -- 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=42973 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |Laura.escamilla@bywatersolu |ity.org |tions.com Patch complexity|--- |Trivial patch -- 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=42973 --- Comment #1 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 201389 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201389&action=edit Bug 42973: Restore manual ordering for news To test: 1. Create four OPAC news items: - "Pinned news item" with "Appear in position" = 1 and an older publication date. - "Newest unnumbered news item" with no position and the newest publication date. - "Middle unnumbered news item" with no position and an intermediate publication date. - "Oldest unnumbered news item" with no position and the oldest publication date. 2. View the OPAC main page. 3. Confirm the news items are ordered by publication date, with the newest item first. Apply the patch. 4. Reload the OPAC main page. 5. Confirm the manually positioned news item appears first. 6. Confirm the remaining news items are ordered by publication date descending. 7. Confirm news items without an "Appear in position" value continue to display newest first. 8. Sign off and have a wonderful day! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42973 --- Comment #2 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- While working on the follow-up, I confirmed that the staff interface uses the same Koha::AdditionalContents->search_for_display() method (mainpage.pl) as the OPAC. Because of that, restoring the ordering logic in Koha::AdditionalContents->search_for_display() updates the ordering for both the OPAC and the staff interface. I tested both: OPAC main page: manually positioned news items appear first, followed by unnumbered news ordered by publication date (newest first). Staff main page: the same ordering is applied. No additional changes to mainpage.pl were required, as both interfaces share the same search method. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42973 --- Comment #3 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 201398 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201398&action=edit Bug 42973: Unit test Added a unit test to confirm that search_for_display orders manually positioned news first, followed by unnumbered news by publication date descending. Test passes: prove t/db_dependent/Koha/AdditionalContents.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42973 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=42973 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201389|0 |1 is obsolete| | Attachment #201398|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=42973 --- Comment #4 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 201409 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201409&action=edit Bug 42973: Restore manual ordering for news To test: 1. Create four OPAC news items: - "Pinned news item" with "Appear in position" = 1 and an older publication date. - "Newest unnumbered news item" with no position and the newest publication date. - "Middle unnumbered news item" with no position and an intermediate publication date. - "Oldest unnumbered news item" with no position and the oldest publication date. 2. View the OPAC main page. 3. Confirm the news items are ordered by publication date, with the newest item first. Apply the patch. 4. Reload the OPAC main page. 5. Confirm the manually positioned news item appears first. 6. Confirm the remaining news items are ordered by publication date descending. 7. Confirm news items without an "Appear in position" value continue to display newest first. 8. Sign off and have a wonderful day! Signed-off-by: Gretchen Maxeiner <MaxeinerGL@gcc.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42973 --- Comment #5 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 201410 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201410&action=edit Bug 42973: Unit test Added a unit test to confirm that search_for_display orders manually positioned news first, followed by unnumbered news by publication date descending. Test passes: prove t/db_dependent/Koha/AdditionalContents.t Signed-off-by: Gretchen Maxeiner <MaxeinerGL@gcc.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42973 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=39027 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org