I think I found a bug in CTreeView

When I upgraded to Yii 1.1.7 a page that uses the CTreeView component started to give me a PHP error: Undefined index: css at CTreeView.php line 211.

So I took a look at CTreeView.php and replaced


$options=isset($node['htmlOptions']) ? $node['htmlOptions'] : array();

if($css!=='')

{

	if(isset($options['css']))

		$options['css'].=' ';

	$options['css'].=$css; // <<<=== line 211

}

with the following:


$options=isset($node['htmlOptions']) ? $node['htmlOptions'] : array();

if($css!=='')

{

	if(isset($options['class']))

		$options['class'].=' ' . $css;

	else 

		$options['class']=$css;

}

And everything is working fine again. :)

Looks like the ‘css’ is not used anymore.

This has already been solved in the SVN trunk…

Roger That!

I do not use the trunk files but it’s good to know that the next Yii release will contain the fix.

I’ll stay with my fix for now.

Thank you.