From: <gem...@li...> - 2011-11-30 21:57:16
|
Revision: 319 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=319&view=rev Author: michieltcs Date: 2011-11-30 21:57:10 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Only call toArray() on non-null object Modified Paths: -------------- branches/1.5.0-pulse/library/classes/MUtil/Model/DatabaseModelAbstract.php Modified: branches/1.5.0-pulse/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- branches/1.5.0-pulse/library/classes/MUtil/Model/DatabaseModelAbstract.php 2011-11-30 13:19:06 UTC (rev 318) +++ branches/1.5.0-pulse/library/classes/MUtil/Model/DatabaseModelAbstract.php 2011-11-30 21:57:10 UTC (rev 319) @@ -417,12 +417,14 @@ $wheres[] = $adapter->quoteInto($text, $value); } // Retrieve the record from the database - $oldValues = $table->fetchRow('(' . implode(' ) AND (', $wheres) . ')')->toArray(); + $oldValues = $table->fetchRow('(' . implode(' ) AND (', $wheres) . ')'); if (! $oldValues) { // MUtil_Echo::r('INSERT!!', 'Old not found'); // Apparently the record does not exist in the database $update = false; + } else { + $oldValues = $oldValues->toArray(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |