Bug when rendering textFieldRow in tabular input

Ivaylo Ushev avatarIvaylo Ushev created an issue

When rendering textFieldRow in tabulat input after row 23 in file 'BootInputHorizontal.php' attribute is changed. This happen because function 'getContainerCssClass' in class 'BootInput' call CHtml::resolveName which change attribute from '[1]name' to 'name'. May solution is change function getContainerCssClass like this:

/**
 * Returns the container CSS class for the input.
 * @return string the CSS class.
 */
protected function getContainerCssClass()
{
	$attribute = $this->attribute; // create copy of attribute to avoid changing original
	CHtml::resolveName($this->model, $attribute); // this function return get_class($model).'['.$attribute.']', hasErrors expect only attribute
       	if ($this->model->hasErrors($attribute)))
		return CHtml::$errorCss;
	else
		return '';
}

This will prevent changing attribute and textFieldRow is rendering well.

Comments (6)

  1. Anonymous

    In file BootInput.php "CHtml::resolveName($this->model, $attribute)" return "get_class($model).'['.$attribute.']'. Function "setError()" expect only "attribute", not "modelclass[attribute]". Тherefore "CHtml::resolveName($this->model, $attribute)" should outside and pass to "setError()" - $attribute. For me this issue is still not resolved.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.