From: Mikael Nordfeldth Date: Mon, 11 Jan 2016 18:52:33 +0000 (+0100) Subject: Do updateWithKeys properly if someone would like to update PRI X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=93c614c184d30ae9cc199c7f020e4651392c2d7b;p=quix0rs-gnu-social.git Do updateWithKeys properly if someone would like to update PRI --- diff --git a/classes/Managed_DataObject.php b/classes/Managed_DataObject.php index 7492d90978..68de8922ce 100644 --- a/classes/Managed_DataObject.php +++ b/classes/Managed_DataObject.php @@ -420,7 +420,7 @@ abstract class Managed_DataObject extends Memcached_DataObject * @param DB_DataObject &$orig Must be "instanceof" $this * @param string $pid Primary ID column (no escaping is done on column name!) */ - public function updateWithKeys(&$orig, $pid='id') + public function updateWithKeys(Managed_DataObject $orig, $pid='id') { if (!$orig instanceof $this) { throw new ServerException('Tried updating a DataObject with a different class than itself.'); @@ -456,7 +456,7 @@ abstract class Managed_DataObject extends Memcached_DataObject common_database_tablename($this->tableName()), implode(', ', $parts), $pid, - $this->_quote($this->$pid)); + $this->_quote($orig->$pid)); $result = $this->query($qry); if ($result === false) {