Bug 35753

Summary: Checkbox() function in additional-contents not necessary
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Staff interfaceAssignee: Lucas Gass (lukeg) <lucas>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jonathan.druart, victor
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.03
Circulation function:
Bug Depends on: 35752    
Bug Blocks:    
Attachments: Bug 35753: Remove Checkbox() function
Bug 35753: Remove Checkbox() function
Bug 35753: Remove Checkbox() function

Description Lucas Gass (lukeg) 2024-01-09 21:56:26 UTC
There is a function in additional-contents.tt called Checkbox(). It checks to see if any checkboxes are checked. Can we just check the length with a selector and get rid of the function?
Comment 1 Lucas Gass (lukeg) 2024-01-09 22:01:16 UTC
Created attachment 160727 [details] [review]
Bug 35753: Remove Checkbox() function

To test:
1. APPLY PATCH and clear browser cache.
2. Have multiple additional content items ( news/HTML customization/Pages )
3. From one of the pages ( news/HTML customization/Pages ) click the 'Delete selected' button. Since no items are checked you should see the 'Please select content to delete' alert.
4. Check some items and click 'Delete selected' they should be correctly deleted.

Note: There is no change in behavior from this patch.
Comment 2 Jonathan Druart 2024-01-11 08:01:54 UTC
Created attachment 160800 [details] [review]
Bug 35753: Remove Checkbox() function

To test:
1. APPLY PATCH and clear browser cache.
2. Have multiple additional content items ( news/HTML customization/Pages )
3. From one of the pages ( news/HTML customization/Pages ) click the 'Delete selected' button. Since no items are checked you should see the 'Please select content to delete' alert.
4. Check some items and click 'Delete selected' they should be correctly deleted.

Note: There is no change in behavior from this patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Victor Grousset/tuxayo 2024-01-18 23:54:36 UTC
Created attachment 161164 [details] [review]
Bug 35753: Remove Checkbox() function

To test:
1. APPLY PATCH and clear browser cache.
2. Have multiple additional content items ( news/HTML customization/Pages )
3. From one of the pages ( news/HTML customization/Pages ) click the 'Delete selected' button. Since no items are checked you should see the 'Please select content to delete' alert.
4. Check some items and click 'Delete selected' they should be correctly deleted.

Note: There is no change in behavior from this patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 4 Victor Grousset/tuxayo 2024-01-18 23:56:08 UTC
Much simpler, thanks :D

Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 5 Katrin Fischer 2024-01-29 11:29:14 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Fridolin Somers 2024-02-01 15:10:45 UTC
Pushed to 23.11.x for 23.11.03