When DEBUG is turned on under Plack, any attempt to delete an authorized value from the staff client interface results in a DBD error: DBD::mysql::st execute failed: Unknown column 'id' in 'where clause' at /home/jcamins/kohaclone/admin/authorised_values.pl line 228. at /home/jcamins/kohaclone/admin/authorised_values.pl line 300
Created attachment 14038 [details] [review] Bug 9272: Eliminate error when deleting authorized value Prior to this patch, when DEBUG was turned on, any attempt to delete an authorized value from the staff client interface resulted in a DBD error: DBD::mysql::st execute failed: Unknown column 'id' in 'where clause' at /home/jcamins/kohaclone/admin/authorised_values.pl line 228. at /home/jcamins/kohaclone/admin/authorised_values.pl line 300 This patch corrects a column name so that the error won't occur. To test: 1) Set the environment variable DEBUG to true for your Koha VirtualHost with "SetEnv DEBUG 1" 2) Reload Apache 3) Try to delete an authorized value. Note you get an error even though the authorized value is deleted. 4) Apply patch. 5) Repeat step 3, noticing that this time there is no error.
Even without Plack the issue exists. Your patch works great but I am under the impression that the query is useless: There is the "on delete cascade" option on the constraint (authorised_values_branches_ibfk_1). So normally the deletion should be automatic and then this query never deletes something. I can provide a patch if you confirm that the query is useless.
(In reply to comment #2) > Even without Plack the issue exists. Your patch works great but I am under > the impression that the query is useless: There is the "on delete cascade" > option on the constraint (authorised_values_branches_ibfk_1). So normally > the deletion should be automatic and then this query never deletes something. > > I can provide a patch if you confirm that the query is useless. I can confirm that when I tested my patch there were never any rows for that query to delete. Now that you point out the constraint, I realize that this was not a coincidence. A counter-patch would be welcomed.
Created attachment 14044 [details] [review] Bug 9272: Eliminate error when deleting authorized value Try to delete an authorized value. if you don't get any error, this patch works.
Created attachment 14106 [details] [review] Bug 9272: Eliminate error when deleting authorized value Try to delete an authorized value. if you don't get any error, this patch works. Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Enabled debug, tried with and without Plack, works fine for both.
Created attachment 14313 [details] [review] Bug 9272: Eliminate error when deleting authorized value Try to delete an authorized value. if you don't get any error, this patch works. Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Enabled debug, tried with and without Plack, works fine for both. Signed-off-by: Elliott Davis <elliott@bywatersolions.com> Works as advertised. Follows coding guidelines.
This patch has been pushed to master.
Was pushed to 3.10.x a while back, missed updating the status