verbb / super-table

Super-charge your Craft workflow using Super Table.
MIT License
316 stars 47 forks source link

Can't order by an entry field title #507

Open goraxan opened 1 year ago

goraxan commented 1 year ago

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

daniellelecomte commented 11 months ago

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

goraxan commented 11 months ago

@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.