yii2-taggable
yii2-taggable copied to clipboard
Not working setting orderAttribute to false
Hello! I suppose doesn't work setting $orderAttribute to "false" in class TaggableBehavior. If is setting it to false i have an error when searching tags:
return $tc::find()->innerJoin($this->junctionTable . ' j', [ $tpk => $tkn ])
->where(['j.' . $this->modelKeyAttribute => $ownerPk])
->orderBy('j.' . $this->orderAttribute);
in method TaggableBehavior::getTags(). Thing there should be something like that:
$query = $tc::find()->innerJoin($this->junctionTable . ' j', [ $tpk => $tkn ])
->where(['j.' . $this->modelKeyAttribute => $ownerPk]);
if ($this->orderAttribute) {
$query->orderBy('j.' . $this->orderAttribute);
}
return $query;