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

Request #6555 Can't update register with id 0
Submitted: 2006-01-23 03:51 UTC
From: vtamara at pasosdejesus dot org Assigned:
Status: Suspended Package: DB_DataObject
PHP Version: Irrelevant OS: Any
Roadmaps: (Not assigned)    
Subscription  


 [2006-01-23 03:51 UTC] vtamara at pasosdejesus dot org
Description: ------------ The function update (even in CVS) includes the following piece of code: if (empty($this->{$keys[0]}) && $dataObject !== true) { $this->raiseError("update: trying to perform an update without the key set, and argument to update is not DB_DATAOBJECT_WHEREADD_ONLY ", DB_DATAOBJECT_ERROR_INVALIDARGS); return false; } Since the empty function returns true when its argument is 0, the error is produced also when the key of the DataObject is 0. In my humble opinion the condition of the if should be: if ($this->{$keys[0]}!=0 && empty($this->{$keys[0]}) && $dataObject !== true) { Am I right? Best regards. Thanks for the good work. God illuminate us.

Comments

 [2006-01-23 05:09 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2010-04-26 04:09 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!