From a1e47b0d3e77fcaeb992a752cec0d3c589614603 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 11 May 2015 15:26:59 +1200 Subject: [PATCH] BUG Fix dropdown not selecting correct status --- code/dataobjects/QueuedJobDescriptor.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/code/dataobjects/QueuedJobDescriptor.php b/code/dataobjects/QueuedJobDescriptor.php index 6d881d7c..c2bf49af 100644 --- a/code/dataobjects/QueuedJobDescriptor.php +++ b/code/dataobjects/QueuedJobDescriptor.php @@ -161,18 +161,19 @@ public function getCMSFields() { QueuedJob::LARGE => 'Large' )) ); + $statuses = array( + QueuedJob::STATUS_NEW, + QueuedJob::STATUS_INIT, + QueuedJob::STATUS_RUN, + QueuedJob::STATUS_WAIT, + QueuedJob::STATUS_COMPLETE, + QueuedJob::STATUS_PAUSED, + QueuedJob::STATUS_CANCELLED, + QueuedJob::STATUS_BROKEN + ); $fields->replaceField( 'JobStatus', - new DropdownField('JobStatus', $this->fieldLabel('JobStatus'), array( - QueuedJob::STATUS_NEW, - QueuedJob::STATUS_INIT, - QueuedJob::STATUS_RUN, - QueuedJob::STATUS_WAIT, - QueuedJob::STATUS_COMPLETE, - QueuedJob::STATUS_PAUSED, - QueuedJob::STATUS_CANCELLED, - QueuedJob::STATUS_BROKEN - )) + new DropdownField('JobStatus', $this->fieldLabel('JobStatus'), array_combine($statuses, $statuses)) );