From bug 28854 comment 515 (In reply to Martin Renvoize from comment #269) > (In reply to Katrin Fischer from comment #224) > > d) Should we be able to change contents of a bundle while it is checked out? > > At the moment it's possible. Maybe a 'safety question'? (question/suggestion) > > Fixed in follow-up. This is not working, there is some code in the template to disable the buttons but it does not work. I have a patch to fix it, but I am wondering if it is correct to disable the edition of a bundle item that is checked out. There is no code server-side to prevent that (and so it's currently possible). Should we fix or remove this restriction?
Created attachment 151623 [details] [review] Bug 33817: Prevent item bundle that is checked out to be modified
From IRC we came to the conclusion: * Bundles should not be editable whilst checked out (Removing and Adding should both be blocked at client and server side) * Items should not be available for adding to a bundle when they are individually checked out (Again, this should be blocked at both the client and the server). The real world idea of this was that you physically had a 'box' you were packing your items into to create the bundle.. you scan your items into the box and out of the box.. thus they should physically be there. We then track their presence at the checkin/checkout actions.
Created attachment 151660 [details] [review] Bug 33817: Enforce server-side
Thanks for your work here Jonathan.., testing not, but the code looks solid :)
Created attachment 151662 [details] [review] Bug 33817: Prevent item bundle that is checked out to be modified Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 151663 [details] [review] Bug 33817: Enforce server-side Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
All working as originally intended and covered by tests too.. Signing off.
Found this when testing for server side enforcement: 0. apply patches 1. have a bundle 2. have it's page opened and it's manage bundle menu too 3. in another tab, check the bundle out [U+1F608] 4. back to the 1st tab, try to add another item to the bundle 5. error: "Failure: Item 'BARCODE' belongs to another bundle" this is false! note: API response: 409 and error bundle_checked_out, nothing wrong here it seems 6. try to remove an item 7. nothing happens, which is okay 8. API response: 501 not implemented, error: No response rule for "409" Is the wrong message UI at step 5 a big deal? Same question for API response at step 8.
Created attachment 152723 [details] [review] Bug 33817: Prevent item bundle that is checked out to be modified Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152724 [details] [review] Bug 33817: Enforce server-side Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 152725 [details] [review] Bug 33817: (follow-up) Fix spec and messages This patch should resolve the issues highlighted at signoff time by Victor.
...problem descriptions and test plans in commit messages please?
Created attachment 153228 [details] [review] Bug 33817: Prevent item bundle that is checked out to be modified While an item bundle is checked out, we don't want any items to be added or removed from the bundle. To test: * Create a record with LDR Pos. 7 = c * Add an item for your bundle * Add one or more existing items from other records to the bundle * Check out the bundle item * Verify it appears correctly on the patron account * Verify you can still add/remove items from the bundle * Apply patch set * Verify that the add/remove links are now disabled (greyed out) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 153229 [details] [review] Bug 33817: Enforce server-side Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 153230 [details] [review] Bug 33817: (follow-up) Fix spec and messages This patch should resolve the issues highlighted at signoff time by Victor. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 153293 [details] [review] Bug 33817: (QA follow-up) Fix tidyness This patch fixes some reported tidyness issues with the patches. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 23.11. Nice work everyone, thanks!
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to oldstable for 22.11.x