koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ambrose C. LI
Subject: [Koha-cvs] CVS: koha/C4 Catalogue.pm,1.36.2.3,1.36.2.4
Date: Sat, 06 Mar 2004 21:38:47 -0800

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;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]