[Fixed] Yii 1.1.5 add unnecessary scripts




<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'login-form',

	'enableAjaxValidation'=>false,

)); ?>



In 1.1.5 it’s add




<script type="text/javascript" src="/assets/3891b453/jquery.js"></script>

<script type="text/javascript">

/*<![CDATA[*/

jQuery(function($) {


				if(!window.location.hash)

					$('').focus();

			

});

/*]]>*/

</script>



In 1.1.4 framework doesn’t add unnecessary scripts

Thanks. Fixed.

Thats how i fixed

framework/web/widgets/CActiveForm.php

1.1.5


		

	public function run()

	{

		if(is_array($this->focus))

			$this->focus="#".CHtml::activeId($this->focus[0],$this->focus[1]);


		echo CHtml::endForm();

		if(!$this->enableAjaxValidation || empty($this->_attributes))

		{       return;

			Yii::app()->clientScript->registerScript('CActiveForm#focus',"

				if(!window.location.hash)

					$('".$this->focus."').focus();

			");

			return;

		}

//........

}



1.1.4




	public function run()

	{

		echo CHtml::endForm();

		if(!$this->enableAjaxValidation || empty($this->_attributes))

			return;

//....

}