In cataloging_additem.js there is a check for op != 'saveitem' that needs to be updated to op != 'cud-saveitem' In additem.pl and additem.tt all instances of 'saveitem' have been updated to 'cud-save-item' The javascript's functionality is explained in bug 22669. It's related to editing items when receiving an order.
Created attachment 169890 [details] [review] Bug 37536: Update conditional to check for 'cud-saveitem' In additem.pl and additem.tt all instances of 'saveitem' have been updated to 'cud-save-item' The javascript needs to be updated in the same way. Test plan: 1. git grep 'saveitem' 2. Notice all instances in additem.pl and additem.tt have been updated to 'cud-saveitem' 3. Notice cataloging_additem.js checks if op != 'saveitem' 4. Check the files and verify the change makes sense 5. Try the test plan from Bug 22669
From bug 22669 test plan: > - Make sure acqcreateitem is set to "when placing an order" where is that acqcreateitem thing? --- > Test plan: > 1. git grep 'saveitem' > 2. Notice all instances in additem.pl and additem.tt have been updated to > 'cud-saveitem' > 3. Notice cataloging_additem.js checks if op != 'saveitem' > 4. Check the files and verify the change makes sense These 1st steps are actually additional and welcome QA notes to help the code review. The test plan is just about blindly following instructions to confirm that the patch does what is says it does. So the actual test plan would be the one from Bug 22669 remixed to witness a CSRF error before the patch and then witnessing it being gone after the patches.
Thanks Victor. acqcreateitem is a system preference and I believe the default is 'when placing an order' Yes the actual test is on Bug 22669. When I tested I didn't see the CSRF error, but the pop up opens and closes abruptly as described in that bug.
Created attachment 170044 [details] [review] Bug 37536: Update conditional to check for 'cud-saveitem' In additem.pl and additem.tt all instances of 'saveitem' have been updated to 'cud-save-item' The javascript needs to be updated in the same way. Test plan: 1. Same as test plan from Bug 22669. Same symptom. QA notes: 1. git grep 'saveitem' 2. Notice all instances in additem.pl and additem.tt have been updated to 'cud-saveitem' 3. Notice cataloging_additem.js checks if op != 'saveitem' 4. Check the files and verify the change makes sense Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
> acqcreateitem is a system preference and I believe the default is 'when placing an order' Thanks, somehow I didn't find it and when searching in the code I forgot to search case insensitively ^^" --- > Yes the actual test is on Bug 22669. When I tested I didn't see the CSRF error, but the pop up opens and closes abruptly as described in that bug. Ok it's the same symptom. --- Patch works! :)
Created attachment 170220 [details] [review] Bug 37536: Update conditional to check for 'cud-saveitem' In additem.pl and additem.tt all instances of 'saveitem' have been updated to 'cud-save-item' The javascript needs to be updated in the same way. Test plan: 1. Same as test plan from Bug 22669. Same symptom. QA notes: 1. git grep 'saveitem' 2. Notice all instances in additem.pl and additem.tt have been updated to 'cud-saveitem' 3. Notice cataloging_additem.js checks if op != 'saveitem' 4. Check the files and verify the change makes sense Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Thanks for the fix! QA tool passes, and it works and makes sense. Passing QA
Created attachment 170221 [details] [review] Bug 37536: Update conditional to check for 'cud-saveitem' In additem.pl and additem.tt all instances of 'saveitem' have been updated to 'cud-save-item' The javascript needs to be updated in the same way. Test plan: - Make sure acqcreateitem is set to "when placing an order" - Create a basket with some orders - Close the basket - Go to your vendor and receive an order - On the receive page, try to edit your item => Without the patch, the pop up page will open and then close, not allowing the item to be edited. => With this patch applied you will see the item edit form. Save and confirm that the parent window is updated with the new value (actually it's refreshed) QA notes: 1. git grep 'saveitem' 2. Notice all instances in additem.pl and additem.tt have been updated to 'cud-saveitem' 3. Notice cataloging_additem.js checks if op != 'saveitem' 4. Check the files and verify the change makes sense Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
*** Bug 37589 has been marked as a duplicate of this bug. ***
Pushed for 24.11! Well done everyone, thank you!
Backported to 24.05.x for upcoming 24.05.05
Not for 23.11.x