[Bug 43192] New: Lists cannot be deleted from OPAC
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 Bug ID: 43192 Summary: Lists cannot be deleted from OPAC Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Lists Assignee: koha-bugs@lists.koha-community.org Reporter: david.roberts@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Target Milestone: --- Lists cannot be deleted from the OPAC if they contain items. To reproduce: Log into the OPAC and add a list Add an item to that list. Try to delete it - nothing happens. It generates the following errors in the browser console: Uncaught TypeError: s.escapeHtml is not a function at escape_str (global_25.1106000.js:53:26) at HTMLButtonElement.<anonymous> (opac-shelves.pl:2094:81) at HTMLButtonElement.dispatch (jquery-3.6.0.min_25.1106000.js:2:43064) at v.handle (jquery-3.6.0.min_25.1106000.js:2:41048) To get around this, it is necessary to delete all the items from the list first before you can successfully delete the list -- 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=43192 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Status|NEW |ASSIGNED Depends on| |42252 Version|unspecified |Main Assignee|koha-bugs@lists.koha-commun |oleonard@myacpl.org |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42252 [Bug 42252] Stored XSS when deleting a list or removing a list share -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Comma delimited| |Athens County Public list of Sponsors| |Libraries Patch complexity|--- |Trivial patch 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=43192 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 202664 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202664&action=edit Bug 43192: Lists cannot be deleted from OPAC The new escape_str function in the OPAC seems to be unhappy when passed a Number. This patch converts the variable to a string before applying escapeHtml. To test, apply the patch and log in to the OPAC. - If necessary, add a list. - Search for records in the catalog and add one or more of the results to your new list. - Go to Lists -> Your lists. - In the list of your lists, click the "Delete" link for the list you added records to. - You should see a confirmation modal, "Are you sure you want to delete this list?" showing the name of the list and the number of items on it. - Clicking "Yes, delete" should delete the list. Sponsored-by: Athens County Public Libraries -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 Roman Dolny <roman.dolny@jezuici.pl> 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=43192 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202664|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=43192 --- Comment #2 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 202711 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202711&action=edit Bug 43192: Lists cannot be deleted from OPAC The new escape_str function in the OPAC seems to be unhappy when passed a Number. This patch converts the variable to a string before applying escapeHtml. To test, apply the patch and log in to the OPAC. - If necessary, add a list. - Search for records in the catalog and add one or more of the results to your new list. - Go to Lists -> Your lists. - In the list of your lists, click the "Delete" link for the list you added records to. - You should see a confirmation modal, "Are you sure you want to delete this list?" showing the name of the list and the number of items on it. - Clicking "Yes, delete" should delete the list. Sponsored-by: Athens County Public Libraries Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au QA Contact|testopia@bugs.koha-communit |dcook@prosentient.com.au |y.org | --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Logical change. Just processing it now... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- I'm going to amend the patch summary to be more in line with https://wiki.koha-community.org/wiki/Commit_messages#Subject_line_.28summary... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 David Cook <dcook@prosentient.com.au> 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=43192 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Created attachment 202722 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202722&action=edit Bug 43192: Cast escape_str(obj) arg to string to use escapeHtml func The escape_str function in the OPAC requires the argument to be a string, and will throw a fatal error if passed a Number. This is because String.prototype.escapeHtml is created by Koha and is not a JS standard. This patch converts the object to a string before applying escapeHtml. To test, apply the patch and log in to the OPAC. - If necessary, add a list. - Search for records in the catalog and add one or more of the results to your new list. - Go to Lists -> Your lists. - In the list of your lists, click the "Delete" link for the list you added records to. - You should see a confirmation modal, "Are you sure you want to delete this list?" showing the name of the list and the number of items on it. - Clicking "Yes, delete" should delete the list. Sponsored-by: Athens County Public Libraries Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202711|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=43192 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=37799 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43201 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- If it's not too much trouble, could you do a patch for bug 43201 too, Owen? :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43192 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.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=43192 --- Comment #7 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org