From 0833fe2e403f24589adcae5d46f65043bacb20a4 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Tue, 19 Nov 2013 10:30:28 -0500 Subject: [PATCH] Fixed test break. --- framework/yii/data/Sort.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/yii/data/Sort.php b/framework/yii/data/Sort.php index 97a8649..6630cfd 100644 --- a/framework/yii/data/Sort.php +++ b/framework/yii/data/Sort.php @@ -355,10 +355,10 @@ class Sort extends Object $definition = $this->attributes[$attribute]; $directions = $this->getAttributeOrders(); if (isset($directions[$attribute])) { - $descending = !$directions[$attribute]; + $descending = $directions[$attribute] === SORT_DESC; unset($directions[$attribute]); } else { - $descending = !empty($definition['default']); + $descending = isset($definition['default']) && $definition['default'] === SORT_DESC; } if ($this->enableMultiSort) {