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

Fix handling of sort option closures. #13

Merged
merged 2 commits into from Oct 29, 2020

Conversation

gwillz
Copy link
Contributor

@gwillz gwillz commented Oct 28, 2020

SearchTypes::getSortOptions assumed that orderBy is always a string and breaks otherwise.

As documented in craft/base/ElementInterface:

orderBy – An array, comma-delimited string, or a callback function that defines the columns to order the query by. If set to a callback function, the function will be passed a single argument, $dir, set to either SORT_ASC or SORT_DESC, and it should return an array of column names or an [[\yii\db\ExpressionInterface]] object.

Yeah so we couldn't even create a 'search setup' without it breaking. So I just wrapped it up.

In testing the admin interface now works. I haven't gone much further than that.

SearchTypes::getSortOptions assumed that orderBy is always a string and breaks otherwise.
@pdaleramirez pdaleramirez merged commit fff460d into pdaleramirez:master Oct 29, 2020
@pdaleramirez
Copy link
Owner

@gwillz Thank you very much for your pull request. I hadn't notice that It was breaking on newer version of Craft.

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

Successfully merging this pull request may close these issues.

None yet

2 participants