Strange Findall Behavior

I have strange Yii behavior:

OS: Linux Debian 6

Browser: Any

Yii: 1.1.11

Behavior:

I have page with admin CGridView on simple column2 template layout.

In content(left column) I have the code:




<?php $this->widget('zii.widgets.grid.CGridView', array(

	'id'=>'keywords-grid',

	'dataProvider'=>$dataProvider,

	'filter'=>$model,

	'columns'=>array(

		'id',

		array(

		    'name'=>'keywordName',

		    'value' => '$data->getKeyword()',

		),

		'count',

		array(

			'class'=>'CButtonColumn',

		),

	),

)); ?>



In column 2 (right) I have running the widget:




class KeywordsMenu extends CWidget {

	public function run() {

		$keywordLinks = WallpapersKeywords::model()

		    ->with(array('keyword.keywordName'))

		    ->findAll(

			array(

			    'select' => '*, max(added) as lastAdded, count(*) as cnt',

			    'group' => 'id_key',

			    'limit'=>Yii::app()->params['menuItems'],

			    'order'=> 'lastAdded DESC, cnt DESC', //problem line, in exception id appends here

			)

		    );



Strange behavior is when I click sort on any column of left CGridView page location appends with ?Keywords_sort=id, but I’ve got exception on right CWidget->Run on findAll method (SQL ERROR: No column id). For some reason left sorting parameters column id from CGridView appears in order of widget findAll.

This menu widget is fully different from this left keywords and order always must be ‘order’=> ‘lastAdded DESC, cnt DESC’.

Any ideas?