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

2.7 and Lister subfield sorting column error #1547

Closed
somatonic opened this issue Dec 7, 2015 · 3 comments
Closed

2.7 and Lister subfield sorting column error #1547

somatonic opened this issue Dec 7, 2015 · 3 comments
Labels

Comments

@somatonic
Copy link

I have 2.7.1 and ListerPro 1.0.8. Now the sorting on a subfield isn't working anymore. It was working fine in 2.6.10 and ListerPro 1.0.5.

The field is a PageTable field, sorting now shows the error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column '_sort_table_article_colors_article_images.article_images' in 'order clause'

ryancramerdesign added a commit that referenced this issue Dec 8, 2015
…types that use Page or PageArray, like FieldtypeTable and FieldtypeRepeater
@ryancramerdesign
Copy link
Owner

I've pushed a fix for this. I don't think it could have been working before however (for PageTable), because the code was not there to support it. The non-exception result you saw in 2.6 would have likely been because it was it falling back to the sort by the 'data' column. 2.7 expanded the options for sorting by columns, so it's no longer falling back to a useless sort by the data column, which is why you saw that exception. The latest commit to the dev branch now lets you sort by subfields of PageTable and Repeater. I'm still not sure how useful this actually is, since they are multi-value fields, but at least it's there.

@Renobird
Copy link

Hi Ryan,

I'm having this same issue with sorting. Unrelated to Lister.

In 2.7.1 and prior this worked: sort=page_selector.title

In 2.7.3 I get the following error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column '_sort_page_selector_title.title' in 'order clause'

@Renobird
Copy link

Just to further confirm this issue, in a template I have the following:

$pages->find("template=scholarships, sort=page_selector");
where "page_selector" is a page field.

The above works as expected, but if you add a sub-field to the sort it results in the SQLSTATE error.
$pages->find("template=scholarships, sort=page_selector.title");

I'm going to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants