Yii Framework Forum: Strange Findall Behavior - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Strange Findall Behavior Rate Topic: -----

#1 User is offline   hastenax 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 27-February 12

Posted 23 October 2012 - 01:27 AM

I have strange Yii behavior:

OS: Linux Debian 6
Browser: Any
Yii: 1.1.11


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(
		    'value' => '$data->getKeyword()',
)); ?>

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

class KeywordsMenu extends CWidget {
	public function run() {
		$keywordLinks = WallpapersKeywords::model()
			    'select' => '*, max(added) as lastAdded, count(*) as cnt',
			    'group' => 'id_key',
			    '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?

Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users