creocoder / yii2-taggable

The taggable behavior for the Yii framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overwrite afterSave()

gagiD opened this issue · comments

commented

Hi.

I have afterSave() implemented in ActiveRecord which use TaggableBehavior.
And afterSave() from TaggableBehavior dones't have any effect. When I comment my TaggableBehavior works normal.

Any fix for this?

@gagiD

Any fix for this?

Do you have parent::afterSave($insert, $changedAttributes) at start of your overriden method?

commented

Thanks for answer 😄

Yes.

public function afterSave($insert) 
{
    $return = parent::beforeSave($insert);

    // ...

    return $return;
}

And I added $changedAttributes parameter but no difference.

commented

Oh, this is embarrassing 😬

Sorry for interrupting.