Using the staff interface, if you use the 'Batch delete' option in the cart: - the items are deleted, - they no longer appear in the list of items in the cart, - but the number of items shown as in the cart (next to the menu icon) stays the same (that is, it isn't reduced). For example, 5 items added, 2 items batch deleted, only three items are listed in the cart, the number of items in the cart still shows as 5 (Cart (5)). To replicate using the staff interface: 1. Add some items to a cart. 2. Note the number of items shown next to the cart menu icon in brackets. 3. Open the cart. 4. Select one or more items. 5. Select 'Batch delete'. 6. Delete the items. 7. Open the cart again. 8. The items deleted are no longer listed. 9. The number of items in the cart has not changed.
Also true if you remove a record from the detail page.
Created attachment 117561 [details] [review] Bug 27767: Remove readCookieValue This JS function is not used. It seems that "quit" is not used either
Created attachment 117562 [details] [review] Bug 27767: Update the number of elements in cart if biblio is removed If a bibliographic record is added to the cart then removed (from the detail page or using the batch delete tool), the number of elements in the cart is never updated. This patch reworks how the cookie "intranet_bib_list" is handled in basket.js. The current code is really bad and error prone (parsing a string). Here we are handling the biblionumbers using a JSON serialised array, that makes everything much more simple.
This is just a start, there are much more to do here: 1. Continue to clean the code (addMultiple and delSelRecords for instance) 2. Confirm that the behaviour about the the parent flag (from readCookie) I removed is still working 3. Adapt code at the OPAC 4. Test everything (that's quite huge as it's used from different views) I'd like a bit of help, anyone willing to code golf on this one?
The test plan talks about items, but the cart actually shows the number of records. What works: * Adding and removing from the detail page now updates the number What doesn't work: * Deleting the record doesn't update the cart number * Batch deleting records * Merging records
Additional impact of the bug: downloading cart doesn't work (internal server error) Mitigation: Empty cart to get rid of the invalid data. Valid records can be added to a list to easily re-add them after.