From 36a9f8dcf4939a6db3579e5b54e1304aca5b4f20 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 16 Nov 2015 21:03:55 -0600 Subject: [PATCH] queue: oops: Fix crash adding new columns --- include/class.queue.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/class.queue.php b/include/class.queue.php index 0aea1330d..972bf7c2e 100644 --- a/include/class.queue.php +++ b/include/class.queue.php @@ -162,10 +162,10 @@ class CustomQueue extends SavedSearch { 'column_id' => $info['column_id'], 'sort' => array_search($info['column_id'], $order), 'heading' => $info['heading'], - 'width' => $info['width'] ?: 100 + 'width' => $info['width'] ?: 100, + 'bits' => $info['sortable'] ? QueueColumn::FLAG_SORTABLE : 0, )); $glue->queue = $this; - $glue->setSortable($info['sortable']); $this->columns->add( QueueColumn::lookup($info['column_id']), $glue); } @@ -988,7 +988,7 @@ extends InstrumentedList { $m = parent::getOrBuild($modelClass, $fields, $cache); if ($m && $modelClass === 'QueueColumnGlue') { // Instead, yield the QueueColumn instance with the local fields - // inthe association table as annotations + // in the association table as annotations $m = AnnotatedModel::wrap($m->column, $m, 'QueueColumn'); } return $m; @@ -997,7 +997,9 @@ extends InstrumentedList { function add($column, $glue=null) { $glue = $glue ?: QueueColumnGlue::create(); $glue->column = $column; - parent::add(AnnotatedModel::wrap($column, $glue)); + $anno = AnnotatedModel::wrap($column, $glue); + parent::add($anno); + return $anno; } } -- GitLab