Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working setting orderAttribute to false #10

Open
roro15 opened this issue Jun 15, 2016 · 0 comments
Open

Not working setting orderAttribute to false #10

roro15 opened this issue Jun 15, 2016 · 0 comments

Comments

@roro15
Copy link

roro15 commented Jun 15, 2016

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant