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

Can't order by an entry field title #507

Open
goraxan opened this issue Mar 6, 2023 · 2 comments
Open

Can't order by an entry field title #507

goraxan opened this issue Mar 6, 2023 · 2 comments

Comments

@goraxan
Copy link

goraxan commented Mar 6, 2023

Describe the bug

Is it possible to order supertable blocks by the title of an entry field?

First I've tried to do entry.ffE.orderBy('material.title').all() but I get an error saying Unknown column 'material.title' in 'order clause' which makes sense since it's not in the query. I've also tried to eager load the material field and see if I can filter by the column without luck.

image

Any ideas?
Thanks

Steps to reproduce

Add an entry field into a super table field and try to order by it

Craft CMS version

4.3.6.1

Plugin version

3.0.7

Multi-site?

No response

Additional context

No response

@goraxan goraxan changed the title Can't order by entry field title Can't order by an entry field title Mar 6, 2023
@daniellelecomte
Copy link

@goraxan - did you ever find a solution to this? I'm having a similar issue.

@goraxan
Copy link
Author

goraxan commented Nov 2, 2023

@daniellelecomte a workaround was to create a calculated field which has the same value as the related entry title, and order by that field. It's not ideal but works.

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

2 participants