From 544628cd9907734c46304314b7019b753ac95e89 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Wed, 12 Dec 2012 08:39:44 -0500 Subject: [PATCH] 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. --- admin/authorised_values.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index 9e90182..206a2c2 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -224,7 +224,7 @@ if ($op eq 'add_form') { my $id = $input->param('id'); my $sth=$dbh->prepare("delete from authorised_values where id=?"); $sth->execute($id); - $sth = $dbh->prepare("DELETE FROM authorised_values_branches WHERE id = ?"); + $sth = $dbh->prepare("DELETE FROM authorised_values_branches WHERE av_id = ?"); $sth->execute($id); print "Content-Type: text/html\n\n"; exit; -- 1.7.9.5