Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Doc Bug #12694 $object->update($original);
Submitted: 2007-12-14 21:15 UTC
From: banquette Assigned:
Status: Verified Package: DB_DataObject (version 1.8.7)
PHP Version: 5.2.5 OS: Windows
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 37 - 16 = ?

 
 [2007-12-14 21:15 UTC] banquette (Alex Desktop)
Description: ------------ As a user said on the "update()" page (http://pear.php.net/manual/en/package.database.db-dataobject.db-dataobject.update.php) : When called with $object->update($original); this function appears to return true rather than 0 if no rows are affected. Expected result: ---------------- Should return 0 (as no row affected) Actual result: -------------- return true

Comments

 [2008-01-14 22:12 UTC] banquette (Alex Desktop)
I think in "DataObject.php" file, line 1301 should return "0" and not "true". This corrects the problem but it also might create another one ... Maybe ...
 [2008-01-30 02:33 UTC] alan_k (Alan Knowles)
This is the expected behaviour - it should be documented as such. 0 - some error. 1+ - no of lines updated. true = nothing updated.. (but it could be treated as working anyway)
 [2008-03-03 22:18 UTC] cweiske (Christian Weiske)
The code (and docblock) says that "false" indicates an error. Also, in one case (line #1298), 0 is returned when nothing changed. True is only returned in one case.
 [2008-11-17 20:34 UTC] cweiske (Christian Weiske)
Alan, what's the status here?
 [2009-10-15 13:17 UTC] cweiske (Christian Weiske)
Alan?