From 0f16b95511f17a6597a156b3ef94c4c1a3b84b45 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 20 Feb 2014 19:39:10 +0100 Subject: [PATCH] Bug 11803: use $dbh consistently in _koha_modify_item MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is just some code cleanup, no behavior change expected. Also replacing errstr with err in testing the results. (See DBI.) Test plan: Modify an item and save it. Followed test plan. No problems found. Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton (cherry picked from commit a07b32f4f9090ba0c50c3e510f0be56b8805faeb) Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall (cherry picked from commit c9057046766fc695385449766d29e011d08de574) --- C4/Items.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 05ad3d0591..5fdbccf52e 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -2266,10 +2266,10 @@ sub _koha_modify_item { $query =~ s/,$//; $query .= " WHERE itemnumber=?"; push @bind, $item->{'itemnumber'}; - my $sth = C4::Context->dbh->prepare($query); + my $sth = $dbh->prepare($query); $sth->execute(@bind); - if ( C4::Context->dbh->errstr ) { - $error.="ERROR in _koha_modify_item $query".$dbh->errstr; + if ( $sth->err ) { + $error.="ERROR in _koha_modify_item $query: ".$sth->errstr; warn $error; } return ($item->{'itemnumber'},$error); -- 2.39.5