[Koha-cvs] CVS: koha/C4 Catalogue.pm,1.36.2.3,1.36.2.4

Ambrose C. LI acli at users.sourceforge.net
Sun Mar 7 06:38:47 CET 2004


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27515

Modified Files:
      Tag: rel_2_0
	Catalogue.pm 
Log Message:
This should fix bug 734.

Added a test for the "zero rows affected" condition when trying to update
aqorderbreakdown. According to DBI(3), execute() returns the "number of
rows affected", so we know whether the update has succeeded, or whether we
need to redo the update as an insert.

The error condition (return value -1) is still not being handled. But the
old code did not check for errors either, so this would be reasonable for
the time being.


Index: Catalogue.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Catalogue.pm,v
retrieving revision 1.36.2.3
retrieving revision 1.36.2.4
diff -C2 -r1.36.2.3 -r1.36.2.4
*** Catalogue.pm	6 Mar 2004 20:30:51 -0000	1.36.2.3
--- Catalogue.pm	7 Mar 2004 05:38:45 -0000	1.36.2.4
***************
*** 271,275 ****
    ordernumber=?";
    $sth=$dbh->prepare($query);
!   $sth->execute($bookfund,$ordnum);
    $sth->finish;
  }
--- 271,279 ----
    ordernumber=?";
    $sth=$dbh->prepare($query);
!   if ($sth->execute($bookfund,$ordnum) == 0) { # zero rows affected [Bug 734]
!     $query="insert into aqorderbreakdown (ordernumber,bookfundid) values (?,?)";
!     $sth=$dbh->prepare($query);
!     $sth->execute($ordnum,$bookfund);
!   }
    $sth->finish;
  }





More information about the Koha-cvs mailing list