Watch out when upgrading to 1.1.11 as new CJavaScriptExpression mechanizm breaks backward compatibility in cases like this:
echo $form->dropDownList( $model, 'language', CSLangChooser::getLanguages(), array( 'ajax' => array(
'type'=>'POST',
'url'=>$this->createUrl( 'dynamicSections' ),
'success'=>'js:function(html){jQuery("#Content_id_section").html(html).change();}',
) ) );
problem is line with: ‘success’ and ‘js:’ prefix. in 1.1.11 it is deprecated but CJavaScriptExpression implementation has buggy backward compatibility code:
when you change above to:
echo $form->dropDownList( $model, 'language', CSLangChooser::getLanguages(), array( 'ajax' => array(
'type'=>'POST',
'url'=>$this->createUrl( 'dynamicSections' ),
'success'=>new CJavaScriptExpression( 'function(html){jQuery("#Content_id_section").html(html).change();}' ),
) ) );
it will throw error "Method CJavaScriptExpression::__toString() must return a string value" because of double CJavaScriptExpression wrapping. CHtml::ajax wraps your CJavaScriptExpression with its own because of bug in logical expression whether to apply wrapper or not.