1. Christoffer Niska
  2. yii-bootstrap
  3. Issues
Issue #94 resolved

Bug when rendering textFieldRow in tabular input

Ivaylo 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: {{{

!php

/* * Returns the container CSS class for the input. * PROGRAMMER 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