Yii Framework Forum: Yii 1.1.11 CListView Before/ After AjaxUpdate Bug - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii 1.1.11 CListView Before/ After AjaxUpdate Bug Rate Topic: -----

#1 User is offline   JaSh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 01-August 12

Posted 01 August 2012 - 05:26 PM

Hi,
we think we have found a bug in CListView. The beforeAjaxUpdate function has not worked after update to Yii 1.1.11. We have solved the issue as follows:

From

if($this->afterAjaxUpdate!==null)
		{
			if(!($this->afterAjaxUpdate instanceof CJavaScriptExpression) && strpos($this->afterAjaxUpdate,'js:')!==0)
			{
				$options['beforeAjaxUpdate']=new CJavaScriptExpression($this->afterAjaxUpdate);
			}
			else
			{
				$options['beforeAjaxUpdate']=$this->afterAjaxUpdate;
			}
		}


To

if($this->afterAjaxUpdate!==null)
		{
			if(!($this->afterAjaxUpdate instanceof CJavaScriptExpression) && strpos($this->afterAjaxUpdate,'js:')!==0)
			{
				$options['afterAjaxUpdate']=new CJavaScriptExpression($this->afterAjaxUpdate);
			}
			else
			{
				$options['afterAjaxUpdate']=$this->afterAjaxUpdate;
			}
		}

0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 469
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 02 August 2012 - 01:15 AM

Thanks for reporting this.
It has already been fixed in recent github code: https://github.com/y...5a9a6f1d94d986d
0

#3 User is offline   onemoverx 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 03-August 11

Posted 10 August 2012 - 11:28 PM

Similar bug can be found in zii.widgets.grid.CGridView [line: 429]

if($this->selectionChanged!==null)
{
    if((!$this->ajaxUpdateError instanceof CJavaScriptExpression) && strpos($this->selectionChanged,'js:')!==0)
    {
	$options['selectionChanged']=new CJavaScriptExpression($this->selectionChanged);
    }
     else
    {
        $options['selectionChanged']=$this->selectionChanged;
    }
}


where the correct code should be

if($this->selectionChanged!==null)
{
    if((!$this->selectionChanged instanceof CJavaScriptExpression) && strpos($this->selectionChanged,'js:')!==0)
    {
	$options['selectionChanged']=new CJavaScriptExpression($this->selectionChanged);
    }
     else
    {
        $options['selectionChanged']=$this->selectionChanged;
    }
}

0

#4 User is offline   resurtm 

  • Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 83
  • Joined: 19-December 10

Posted 11 August 2012 - 12:44 AM

Already fixed in the CGridView too.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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