Clicking the 'Empty cart and close' link when viewing the contents of a cart at /cgi-bin/koha/opac-basket.pl does not work. There are javascript security errors because the page opens in a new window but scripts in /opac-tmpl/bootstrap/js/basket.js such as updateBasket try to access and change values in the parent window (referred to as top.opener) - this is blocked by the browser.
Which version of Koha? Which browser? Works for me on master with Firefox 58.0.1
Sorry, thought I'd mentioned the Koha version! It's Koha 17.05.08, browsers tested are: Chrome 63.0.3239.132 Safari 11.0.2 Edge 40.15063.674.0
Work for me on v17.05.08 and chromium 64.0.3282.119
I've tested this in multiple browsers in master and on 17.05.09 and cannot reproduce the problem.
I was able to reproduce on master. It appears that the empty link works until you reload the page, then the items come back. Furthermore the remove items button doesn't work if *all* items are selected, but does if only some of the cart items are selected.
(In reply to Kyle M Hall from comment #5) > I was able to reproduce on master. It appears that the empty link works > until you reload the page, then the items come back. Furthermore the remove > items button doesn't work if *all* items are selected, but does if only some > of the cart items are selected. All because bib_list cookie is not properly deleted.
Created attachment 73788 [details] [review] Bug 20122: Empty lists keep coming back This is caused by bib_list not being deleted. The path was not explicitly set. This patch adds path=/ explicitly to ensure it does get deleted. TEST PLAN --------- 1) search for 'the' in OPAC 2) add several items to cart. 3) look at your cart. 4) empty and close the cart, select all->remove -- either way window closes and it looks empty. 5) refresh the page -- cart comes back. -- in chromium inspecting the page, specifically the "Application" area, bib_list is shown as a cookie still. 6) apply patch 7) restart_all and empty cache forcing JS reload 8) repeat steps 1-5 -- this time cart stays empty. -- and the bib_list cookie is gone 9) run koha qa test tools. NOTE: Shout out to Owen Leonard for this version.
Created attachment 73789 [details] [review] Bug 20122: Empty lists keep coming back This is caused by bib_list not being deleted. The path was not explicitly set. This patch adds path=/ explicitly to ensure it does get deleted. TEST PLAN --------- 1) search for 'the' in OPAC 2) add several items to cart. 3) look at your cart. 4) empty and close the cart, select all->remove -- either way window closes and it looks empty. 5) refresh the page -- cart comes back. -- in chromium inspecting the page, specifically the "Application" area, bib_list is shown as a cookie still. 6) apply patch 7) restart_all and empty cache forcing JS reload 8) repeat steps 1-5 -- this time cart stays empty. -- and the bib_list cookie is gone 9) run koha qa test tools.
Created attachment 73790 [details] [review] Bug 20122: Empty lists keep coming back This is caused by bib_list not being deleted. The path was not explicitly set. This patch adds path=/ explicitly to ensure it does get deleted. TEST PLAN --------- 1) search for 'the' in OPAC 2) add several items to cart. 3) look at your cart. 4) empty and close the cart, select all->remove -- either way window closes and it looks empty. 5) refresh the page -- cart comes back. -- in chromium inspecting the page, specifically the "Application" area, bib_list is shown as a cookie still. 6) apply patch 7) restart_all and empty cache forcing JS reload 8) repeat steps 1-5 -- this time cart stays empty. -- and the bib_list cookie is gone
Created attachment 73803 [details] [review] Bug 20122: Empty lists keep coming back This is caused by bib_list not being deleted. The path was not explicitly set. This patch adds path=/ explicitly to ensure it does get deleted. TEST PLAN --------- 1) search for 'the' in OPAC 2) add several items to cart. 3) look at your cart. 4) empty and close the cart, select all->remove -- either way window closes and it looks empty. 5) refresh the page -- cart comes back. -- in chromium inspecting the page, specifically the "Application" area, bib_list is shown as a cookie still. 6) apply patch 7) restart_all and empty cache forcing JS reload 8) repeat steps 1-5 -- this time cart stays empty. -- and the bib_list cookie is gone Signed-off-by: Roch D'Amour <roch.damour@inlibro.com> using firefox 59.0.2
Created attachment 73828 [details] [review] Bug 20122: Explicitly set path to fix emptying cart functionality This is caused by bib_list not being deleted. The path was not explicitly set. This patch adds path=/ explicitly to ensure it does get deleted. TEST PLAN --------- 1) search for 'the' in OPAC 2) add several items to cart. 3) look at your cart. 4) empty and close the cart, select all->remove -- either way window closes and it looks empty. 5) refresh the page -- cart comes back. -- in chromium inspecting the page, specifically the "Application" area, bib_list is shown as a cookie still. 6) apply patch 7) restart_all and empty cache forcing JS reload 8) repeat steps 1-5 -- this time cart stays empty. -- and the bib_list cookie is gone Signed-off-by: Roch D'Amour <roch.damour@inlibro.com> using firefox 59.0.2 Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Hi Mark, please remember that the patch subject line should describe the patch!
I had assigned this bug to myself, and told you that I had a fix ready. I'm not sure why you duplicated my effort.
Pushed to master for 18.05, thanks to everybody involved!
Pushed to stable for 17.11.06 Awesome work all!
Pushed to 17.05.x for v17.05.12