diff --git a/include/ajax.search.php b/include/ajax.search.php index 2fd01bfe988224d18a18ff6da0ccce33d90efdbf..eb1ef6ed36f534e2e1ad525e13cb4c3e8057e223 100644 --- a/include/ajax.search.php +++ b/include/ajax.search.php @@ -277,7 +277,7 @@ class SearchAjaxAPI extends AjaxController { // Ensure `name` is preserved $field_name = $_GET['field']; $id = $_GET['id']; - $column = QueueColumn::create(array('id' => $_GET['colid'])); + $column = new QueueColumn(array('id' => $_GET['colid'])); $condition = new QueueColumnCondition(); include STAFFINC_DIR . 'templates/queue-column-condition.tmpl.php'; } diff --git a/include/class.orm.php b/include/class.orm.php index 67b92c7dd56d93c0aa7185a94aecef0ccc07f584..662349227c5bc7ac9c0cd33ab5c27c3102d99455 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -1995,7 +1995,7 @@ extends ModelResultSet { $this->queryset = $queryset; } - function add($object, $at=false) { + function add($object, $save=true, $at=false) { // NOTE: Attempting to compare $object to $this->model will likely // be problematic, and limits creative applications of the ORM if (!$object) { @@ -2008,7 +2008,7 @@ extends ModelResultSet { foreach ($this->key as $field=>$value) $object->set($field, $value); - if (!$object->__new__) + if (!$object->__new__ && $save) $object->save(); if ($at !== false) @@ -2111,7 +2111,7 @@ extends ModelResultSet { $this->fillTo($a); if ($obj = $this->storage[$a]) $obj->delete(); - $this->add($b, $a); + $this->add($b, true, $a); } // QuerySet overriedes diff --git a/include/class.queue.php b/include/class.queue.php index 4f782f0974bbddbdfee5496a9e93742002d65b99..09ece8de077efa43383262fce5582111d1431f31 100644 --- a/include/class.queue.php +++ b/include/class.queue.php @@ -1704,7 +1704,7 @@ extends InstrumentedList { $glue = $glue ?: new QueueColumnGlue(); $glue->column = $column; $anno = AnnotatedModel::wrap($column, $glue); - parent::add($anno); + parent::add($anno, false); return $anno; } }