Bug 38309

Summary: Cannot delete additional fields
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: System AdministrationAssignee: Phil Ringnalda <phil>
Status: RESOLVED FIXED QA Contact: Lucas Gass (lukeg) <lucas>
Severity: normal    
Priority: P5 - low CC: david, fridolin.somers, gmcharlt, lucas, phil
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38378
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes deleting additional fields (Administration - Additional parameters > Additional fields) - deleting fields now works as expected. Previously, attempting to delete a field would generate a blank page and the field was not deleted. (This is related to the CSRF changes added in Koha 24.05 to improve form security.)
Version(s) released in:
24.11.00,24.05.06
Circulation function:
Bug Depends on: 36192    
Bug Blocks:    
Attachments: Bug 38309: Cannot delete additional fields
Bug 38309: Cannot delete additional fields
Bug 38309: Cannot delete additional fields

Description Nick Clemens (kidclamp) 2024-10-31 12:30:08 UTC
To recreate:
1 - Browse to Administration->Additional fields
2 - Click 'Invoices (aqinvoices)'
3 - Click 'New field'
4 - Fill out form and save
5 - See the new fiellisted
6 - Click 'Delete', confirm
7 - Screen goes blank
8 - Try to click 'Additional fields' in breadcrumb, no action
9 - Click 'Administration' in breadcrums
10 - Go to Additional fields->Invoices
11 - Your field is still there
Comment 1 Phil Ringnalda 2024-11-01 02:01:49 UTC
Neat, we still have '.pl?op=delete' after all this time.
Comment 2 Phil Ringnalda 2024-11-01 02:52:43 UTC
Created attachment 173851 [details] [review]
Bug 38309: Cannot delete additional fields

Deleting an additional field tries to do a GET of ?op=delete... which no
longer works with CSRF protection. It needs to be a POST with op=cud-delete.

Test plan:
 1. Administration - Additional fields, click any table name
 2. New field, fill in a name and Save
 3. In the row for your field, click Delete
 4. You have a blank page
 5. Apply patch, click the browser Back button, refresh the page
 6. In the row for your undeleted field, click Delete
 7. Your field is deleted

Sponsored-by: Chetco Community Public Library
Comment 3 David Nind 2024-11-01 08:44:12 UTC
Created attachment 173858 [details] [review]
Bug 38309: Cannot delete additional fields

Deleting an additional field tries to do a GET of ?op=delete... which no
longer works with CSRF protection. It needs to be a POST with op=cud-delete.

Test plan:
 1. Administration - Additional fields, click any table name
 2. New field, fill in a name and Save
 3. In the row for your field, click Delete
 4. You have a blank page
 5. Apply patch, click the browser Back button, refresh the page
 6. In the row for your undeleted field, click Delete
 7. Your field is deleted

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Lucas Gass (lukeg) 2024-11-01 17:54:26 UTC
Good to see use of js/form-submit.js here.
Comment 5 Lucas Gass (lukeg) 2024-11-01 17:56:26 UTC
Created attachment 173885 [details] [review]
Bug 38309: Cannot delete additional fields

Deleting an additional field tries to do a GET of ?op=delete... which no
longer works with CSRF protection. It needs to be a POST with op=cud-delete.

Test plan:
 1. Administration - Additional fields, click any table name
 2. New field, fill in a name and Save
 3. In the row for your field, click Delete
 4. You have a blank page
 5. Apply patch, click the browser Back button, refresh the page
 6. In the row for your undeleted field, click Delete
 7. Your field is deleted

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 6 Katrin Fischer 2024-11-07 16:33:57 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Lucas Gass (lukeg) 2024-12-05 21:56:05 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 8 Fridolin Somers 2024-12-18 11:37:43 UTC
Not for 23.11.x
Comment 9 David Nind 2024-12-18 16:35:11 UTC
This s a bug fix and no changes to the user interface, so no changes to the manual required.