Browse files

Merge branch 'master' of git://github.com/yiisoft/yii into clientChan…

…geSubmitDocFix
  • Loading branch information...
2 parents 400d861 + a793880 commit 6051be5a2e037678a479e1ae6755ec236b575e80 @rawtaz committed Oct 5, 2012
Showing with 13 additions and 4 deletions.
  1. +1 −0 CHANGELOG
  2. +2 −2 framework/db/schema/mssql/CMssqlCommandBuilder.php
  3. +10 −2 framework/web/CArrayDataProvider.php
View
1 CHANGELOG
@@ -49,6 +49,7 @@ Version 1.1.13 work in progress
- Enh #1426: Behaviors are now affecting memory consumption significantly less (slavcodev, creocoder, Qiang, samdark)
- Enh #1443: Added CHttpRequest::getRawBody() that allows reading RAW HTTP request body multiple times (itamar82, resurtm, samdark)
- Enh #1518: Allow to configure CHtml::$closeSingleTags and CHtml::$renderSpecialAttributesValue. Useful for HTML5 code (creocoder)
+- Enh #1531: CArrayDataProvider is now able to sort cutted array, where sorting column is not available in every entry (Yiivgeny)
- Enh: Fixed the check for ajaxUpdate false value in jquery.yiilistview.js as that never happens (mdomba)
- Enh: Requirements checker: added check for Oracle database (pdo_oci extension) and MSSQL (pdo_dblib, pdo_sqlsrv and pdo_mssql extensions) (resurtm)
- Enh: Added CChainedLogFilter class to allow adding multiple filters to a logroute (cebe)
View
4 framework/db/schema/mssql/CMssqlCommandBuilder.php
@@ -178,8 +178,8 @@ public function createUpdateCounterCommand($table,$counters,$criteria)
*/
public function applyLimit($sql, $limit, $offset)
{
- $limit = $limit!==null ? intval($limit) : -1;
- $offset = $offset!==null ? intval($offset) : -1;
+ $limit = $limit!==null ? (int)$limit : -1;
+ $offset = $offset!==null ? (int)$offset : -1;
if ($limit > 0 && $offset <= 0) //just limit
$sql = preg_replace('/^([\s(])*SELECT( DISTINCT)?(?!\s*TOP\s*\()/i',"\\1SELECT\\2 TOP $limit", $sql);
elseif($limit > 0 && $offset > 0)
View
12 framework/web/CArrayDataProvider.php
@@ -156,8 +156,16 @@ protected function sortData($directions)
*/
protected function getSortingFieldValue($data, $fields)
{
- foreach ($fields as $field)
- $data = is_object($data) ? $data->$field : $data[$field];
+ if(is_object($data))
+ {
+ foreach($fields as $field)
+ $data=isset($data->$field) ? $data->$field : null;
+ }
+ else
+ {
+ foreach($fields as $field)
+ $data=isset($data[$field]) ? $data[$field] : null;
+ }
return $this->caseSensitiveSort ? $data : mb_strtolower($data,Yii::app()->charset);
}

0 comments on commit 6051be5

Please sign in to comment.