We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 93c614c1 authored by mattl's avatar mattl

Do updateWithKeys properly if someone would like to update PRI

parent c1f22f10
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment