CCache::unserialize ActiveRecord cannot find behavior

It may be too late for a bug fix I know, but maybe someone has come across this one before?

I’ve got a CActiveRecord model that has an attached behavior in ‘application.components.behaviours.LoggableBehavior’.

When I cache an array of objects with this ActiveRecord as a sub-element, subsequent calls to Yii::app()->cache->get($id) fail with an ‘Unable to open Stream (LoggableBehavior.php)’ error.

Completely stumped on this one…

This Stack Overflow article seems to mention the same problem I’m having, but I already have my imports configured.




'import'=>array(

  ...

  'application.components.*',

  ...

),

Does the wildcard not cover sub-folders?

So I explicitly added




'import'=>array(

  'application.components.behaviours.LoggableBehavior'

),



to my main.php config file and that seems to have fixed it.

Wasn’t aware the wildcards wouldn’t include subfolders…