[Bug 21479] New: Removing from cart removes 2 items
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Bug ID: 21479 Summary: Removing from cart removes 2 items Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: major Priority: P5 - low Component: OPAC Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org This bug affects all stable releases and seems to have been there for a long time. To recreate: - Launch a search at the OPAC - Add 2 elements to the cart - Remove one => Cart is empty Note that it does not exist on the staff interface -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=21479 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 79852 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79852&action=edit Bug 21479: Fix remove from cart - OPAC This bug affects all stable releases and seems to have been there for a long time. To recreate: - Launch a search at the OPAC - Add 2 elements to the cart - Remove one => Cart is empty Note that it does not exist on the staff interface The code in opac-bottom is only for the detail page, but the evenement binding was done on the result search page as they have the same selector (.cartRemove) Using a more specific selector (already used for "add to shelf") fixes the problem. Test plan: Add and remove elements to/from your cart On both search and detail view -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 M. Tompsett <mtompset@hotmail.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=21479 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79852|0 |1 is obsolete| | --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 79857 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79857&action=edit Bug 21479: Fix remove from cart - OPAC This bug affects all stable releases and seems to have been there for a long time. To recreate: - Launch a search at the OPAC - Add 2 elements to the cart - Remove one => Cart is empty Note that it does not exist on the staff interface The code in opac-bottom is only for the detail page, where biblionumber is defined, but the event binding was done on the result search page as they have the same selector (.cartRemove) On the results page, the biblionumber is not defined and triggers the deletion of all the items as a result. Using a more specific selector (this solution is already used for "add to shelf") fixes the problem Test plan: Add and remove elements to/from your cart On both search and detail view Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com, | |nick@bywatersolutions.com --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- David reported on IRC he did not recreate the issue, if the problem does not exist for everybody we will need to understand why. Please do not push without knowing all the details. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 79893 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79893&action=edit Bug 21479: (alternate) Removing from cart removes 2 items This patch changes the way biblionumbers are passed to the cart script for adding and removing single items. The title's biblionumber is now stored in a data-attribute on the links for adding and removing. This should be a more robust, unified way to handle these single-item operations. To test, apply the patch and enable the opacbookbag system preference. Test adding and removing items from the cart from various pages using various methods: - By clicking an "Add to your cart" / "Remove" link in search results - By clicking an "Add to your cart" / "Remove" link on a detail page - By checking boxes in search results and adding via the dropdown Each operation should work correctly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Owen, with your patch:
From the result page: Add Go to the detail page, "In your cart (remove)" The "In your cart" link does nothing => KO
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79893|0 |1 is obsolete| | --- Comment #6 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 79903 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79903&action=edit Bug 21479: (alternate) Removing from cart removes 2 items This patch changes the way biblionumbers are passed to the cart script for adding and removing single items. The title's biblionumber is now stored in a data-attribute on the links for adding and removing. This should be a more robust, unified way to handle these single-item operations. To test, apply the patch and enable the opacbookbag system preference. Test adding and removing items from the cart from various pages using various methods: - By clicking an "Add to your cart" / "Remove" link in search results - By clicking an "Add to your cart" / "Remove" link on a detail page - By checking boxes in search results and adding via the dropdown Each operation should work correctly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #7 from David Nind <david@davidnind.com> --- Able to see the problem now - was using cart itself to remove items, rather than adding and removing from the search result list. Getting this message when trying to apply patch (git bz apply 21479): Applying: Bug 21479: Fix remove from cart - OPAC Applying: Bug 21479: (alternate) Removing from cart removes 2 items Using index info to reconstruct a base tree... M koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc error: Failed to merge in the changes. Patch failed at 0001 Bug 21479: (alternate) Removing from cart removes 2 items The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-21479-alternate-Removing-from-cart-removes-2-i-Fk_Tok.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79903|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 79950 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79950&action=edit Bug 21479: (alternate) Removing from cart removes 2 items This patch changes the way biblionumbers are passed to the cart script for adding and removing single items. The title's biblionumber is now stored in a data-attribute on the links for adding and removing. This should be a more robust, unified way to handle these single-item operations. To test, apply the patch and enable the opacbookbag system preference. Test adding and removing items from the cart from various pages using various methods: - By clicking an "Add to your cart" / "Remove" link in search results - By clicking an "Add to your cart" / "Remove" link on a detail page - By checking boxes in search results and adding via the dropdown Each operation should work correctly. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 David Nind <david@davidnind.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=21479 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79950|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80219 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80219&action=edit Bug 21479: (alternate) Removing from cart removes 2 items This patch changes the way biblionumbers are passed to the cart script for adding and removing single items. The title's biblionumber is now stored in a data-attribute on the links for adding and removing. This should be a more robust, unified way to handle these single-item operations. To test, apply the patch and enable the opacbookbag system preference. Test adding and removing items from the cart from various pages using various methods: - By clicking an "Add to your cart" / "Remove" link in search results - By clicking an "Add to your cart" / "Remove" link on a detail page - By checking boxes in search results and adding via the dropdown Each operation should work correctly. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I like Owens alternative.. as he says, it just feels more robust. QA Comment though.. could we possibly add a selenium test for this perhaps? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jonathan.druart@bugs.koha-c |oleonard@myacpl.org |ommunity.org | QA Contact|testopia@bugs.koha-communit |jonathan.druart@bugs.koha-c |y.org |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21174 CC| |alexbuckley@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79857|0 |1 is obsolete| | Attachment #80219|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80291&action=edit Bug 21479: Fix remove from cart links at the OPAC (should remove only 1) This patch changes the way biblionumbers are passed to the cart script for adding and removing single items. The title's biblionumber is now stored in a data-attribute on the links for adding and removing. This should be a more robust, unified way to handle these single-item operations. To test, apply the patch and enable the opacbookbag system preference. Test adding and removing items from the cart from various pages using various methods: - By clicking an "Add to your cart" / "Remove" link in search results - By clicking an "Add to your cart" / "Remove" link on a detail page - By checking boxes in search results and adding via the dropdown Each operation should work correctly. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80292 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80292&action=edit Bug 21479: Add regression tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|jonathan.druart@bugs.koha-c | |ommunity.org | --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Martin Renvoize from comment #10)
I like Owens alternative.. as he says, it just feels more robust.
Agreed.
QA Comment though.. could we possibly add a selenium test for this perhaps?
Done, the patch is waiting for a/your QA stamp. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21174 | Blocks| |21174 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21174 [Bug 21174] Change default behavior to open OPAC cart in one click -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80291|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80304&action=edit Bug 21479: Fix remove from cart links at the OPAC (should remove only 1) This patch changes the way biblionumbers are passed to the cart script for adding and removing single items. The title's biblionumber is now stored in a data-attribute on the links for adding and removing. This should be a more robust, unified way to handle these single-item operations. To test, apply the patch and enable the opacbookbag system preference. Test adding and removing items from the cart from various pages using various methods: - By clicking an "Add to your cart" / "Remove" link in search results - By clicking an "Add to your cart" / "Remove" link on a detail page - By checking boxes in search results and adding via the dropdown Each operation should work correctly. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80292|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 80305 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80305&action=edit Bug 21479: Add regression tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works well, no regressions found. Thankyou for the regression test Jonathan :). Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80557 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80557&action=edit Bug 21479: Remove the trace if the node does not exist Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed for 18.11. Thanks all! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80605 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80605&action=edit Bug 21479: Zebra index can return different result If the zebra index has been rebuilt by previous tests, the order/results will be different, and we will not have biblionumber 1, 3, 5 Let make this more flexible Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #20 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #19)
Created attachment 80605 [details] [review] Bug 21479: Zebra index can return different result
If the zebra index has been rebuilt by previous tests, the order/results will be different, and we will not have biblionumber 1, 3, 5
Let make this more flexible
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Follow up pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80625&action=edit Bug 21479: Mock SearchEngine to use Zebra Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #22 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80643 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80643&action=edit Bug 21479: "Mock" SearchEngine to use Zebra Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.05.x for 18.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80625|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=21479 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #24 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.11.x for 17.11.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19802 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19802 [Bug 19802] Move Selenium code to its own module -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 --- Comment #25 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Regression tests removed from 17.11.x, test suite not able to run selenium for this version. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21479 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22881 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22881 [Bug 22881] Trying to clear search history via the navbar X doesn't clear any searches -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org