Browse Source

Fixed test break.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
0833fe2e40
  1. 4
      framework/yii/data/Sort.php

4
framework/yii/data/Sort.php

@ -355,10 +355,10 @@ class Sort extends Object
$definition = $this->attributes[$attribute]; $definition = $this->attributes[$attribute];
$directions = $this->getAttributeOrders(); $directions = $this->getAttributeOrders();
if (isset($directions[$attribute])) { if (isset($directions[$attribute])) {
$descending = !$directions[$attribute]; $descending = $directions[$attribute] === SORT_DESC;
unset($directions[$attribute]); unset($directions[$attribute]);
} else { } else {
$descending = !empty($definition['default']); $descending = isset($definition['default']) && $definition['default'] === SORT_DESC;
} }
if ($this->enableMultiSort) { if ($this->enableMultiSort) {

Loading…
Cancel
Save