Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed can sorting cutted array with CArrayDataProvider

  • Loading branch information...
commit cbc455dc55beef7cc76b68fb90491fef6b4e592c 1 parent 86859ca
@Yiivgeny Yiivgeny authored
Showing with 7 additions and 2 deletions.
  1. +1 −0  CHANGELOG
  2. +6 −2 framework/web/CArrayDataProvider.php
View
1  CHANGELOG
@@ -3,6 +3,7 @@
Version 1.1.13 work in progress
-------------------------------
+- Bug: Fixed can sorting cutted array with CArrayDataProvider (Yiivgeny)
- Bug #93: Criteria modification in CActiveRecord::beforeFind() did not apply when record was loaded in relational context. See UPGRADE instructions for details on behavior change. (cebe)
- Bug #110: MSSQL: fixed empty $primaryKey value after saving CActiveRecord model (resurtm)
- Bug #112: MSSQL: database abstraction layer now uses native transaction support of the SQLSRV driver (resurtm)
View
8 framework/web/CArrayDataProvider.php
@@ -156,8 +156,12 @@ protected function sortData($directions)
*/
protected function getSortingFieldValue($data, $fields)
{
- foreach ($fields as $field)
- $data = is_object($data) ? $data->$field : $data[$field];
+ foreach($fields as $field){
+ if(is_object($data))
+ $data = isset($data->$field)?$data->$field:null;
+ else
+ $data = isset($data[$field])?$data[$field]:null;
+ }
return $this->caseSensitiveSort ? $data : mb_strtolower($data,Yii::app()->charset);
}
Please sign in to comment.
Something went wrong with that request. Please try again.