Bug 37091 - Cannot delete a local system preference
Summary: Cannot delete a local system preference
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Emily Lamancusa
QA Contact: Julian Maurice
URL:
Keywords:
Depends on:
Blocks: 36192
  Show dependency treegraph
 
Reported: 2024-06-14 14:28 UTC by Emily Lamancusa
Modified: 2024-06-21 18:32 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the forms for local system preferences - these can now be deleted.
Version(s) released in:
24.11.00


Attachments
Bug 37091: Correct op parameter in systempreferences.pl (1.34 KB, patch)
2024-06-14 14:32 UTC, Emily Lamancusa
Details | Diff | Splinter Review
Bug 37091: Correct op parameter in systempreferences.pl (1.38 KB, patch)
2024-06-14 19:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 37091: Correct op parameter in systempreferences.pl (1.44 KB, patch)
2024-06-21 13:13 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emily Lamancusa 2024-06-14 14:28:53 UTC
To reproduce:
1. Go to Administration > System Preferences > Local Use
2. Attempt to delete a local system preference
--> The confirmation page displays a blank name and value
3. Click "Yes, delete"
--> The system preference is still there
Comment 1 Emily Lamancusa 2024-06-14 14:32:23 UTC Comment hidden (obsolete)
Comment 2 David Nind 2024-06-14 19:35:43 UTC
Created attachment 167764 [details] [review]
Bug 37091: Correct op parameter in systempreferences.pl

To test:
1. Go to Administration > System Preferences > Local Use
2. Attempt to delete a local system preference
--> The confirmation page displays a blank name and value
3. Click "Yes, delete"
--> The system preference is still there
4. Apply patch, restart_all, and reload page
5. Attempt to delete the system preference again
--> The confirmation page displays correct information
6. Click "Yes, delete"
--> The system preference is deleted successfully

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-06-14 19:42:14 UTC
Testing notes (using KTD):

1. Before the patch, I get an error trace when trying to delete a local use system preference (either an existing one or a new one):
   Can't call method "delete" on an undefined value at /kohadevbox/koha/C4/Context.pm line 436
.....

2. After the patch, and after the local use system preference is deleted, the body of the page is blank, rather than listing the remaining local use system preferences. The system preference categories are listed on the left, the breadrumb is just "Administration", Search system preferences is selected in the header, and the browser page title is "Local use system preferences > Administration > Koha". I'm not sure what it did before the CSRF patch, and whether this needs fixing as well.
Comment 4 Julian Maurice 2024-06-21 13:00:20 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2024-06-21 13:01:52 UTC
(In reply to Julian Maurice from comment #4)
> The proposed patch removes "cud-" prefix in .pl whereas it is a delete
> operation. The fix should be to add the "cud-" prefix in templ

Please don#t hesitate to set FQA - it helps to alert and keep things moving.
Comment 6 Julian Maurice 2024-06-21 13:10:57 UTC
Ah sorry, I didn't want to send that. I started to write it and noticed I was wrong...  so please ignore. I will probably pass QA in a few minutes :)
Comment 7 Julian Maurice 2024-06-21 13:13:11 UTC
Created attachment 167964 [details] [review]
Bug 37091: Correct op parameter in systempreferences.pl

To test:
1. Go to Administration > System Preferences > Local Use
2. Attempt to delete a local system preference
--> The confirmation page displays a blank name and value
3. Click "Yes, delete"
--> The system preference is still there
4. Apply patch, restart_all, and reload page
5. Attempt to delete the system preference again
--> The confirmation page displays correct information
6. Click "Yes, delete"
--> The system preference is deleted successfully

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 8 Katrin Fischer 2024-06-21 13:18:59 UTC
(In reply to Julian Maurice from comment #6)
> Ah sorry, I didn't want to send that. I started to write it and noticed I
> was wrong...  so please ignore. I will probably pass QA in a few minutes :)

All good then, thanks!
Comment 9 Katrin Fischer 2024-06-21 13:25:17 UTC
Pushed for 24.11!

Well done everyone, thank you!