Bug when using CListView and Taggable behaviour

Hi, I’m using Taggable 1.5 and Yii 1.1.8

It seems that while using “taggedWith” method, there’s some issue with clearing scope or whatever. Have a look at the following code: (note: findScopedAll is the method which returns CActiveDataProvider based on current model’s criteria)


    $first = News::model()->taggedWith('first');    

    echo $first->getDbCriteria(true)->join;

    echo "<hr />";

    $second = News::model()->taggedWith('second');

    echo $second->getDbCriteria(true)->join;

The output is following:


JOIN news_tags bt0 ON t.id = bt0.news_id JOIN tags tag0 ON tag0.id = bt0.tag_id AND tag0.name = 'first'


JOIN news_tags bt0 ON t.id = bt0.news_id JOIN tags tag0 ON tag0.id = bt0.tag_id AND tag0.name = 'first' JOIN news_tags bt0 ON t.id = bt0.news_id JOIN tags tag0 ON tag0.id = bt0.tag_id AND tag0.name = 'second'



as you can see, the second is invalid - it’s simply a merge of previous and new one.

try to use CActiveRecord.resetScope method to clear the scopes used

note: Moved to proper forum ( extensions )

thanks :) that worked as for now but I remember that caused other problems :confused: I’ll let know as the investigation goes :D