-
Notifications
You must be signed in to change notification settings - Fork 325
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
Ignore not existing columns in the ListBuilder #7207
Comments
It looks like bug in the $sortBy = $this->listRestHelper->getSortColumn();
if (null != $sortBy) {
$listBuilder->sort($fieldDescriptors[$sortBy], $this->listRestHelper->getSortOrder());
} should look like this: $sortBy = $this->listRestHelper->getSortColumn();
if (null !== $sortBy && \array_key_exists($sortBy, $fieldDescriptors)) {
$listBuilder->sort($fieldDescriptors[$sortBy], $this->listRestHelper->getSortOrder());
} I copied the original code and fixed it in my own class and decorated the original like this:
and it fixed my problem. Good-enough hotfix for now. |
@MrSrsen Sounds like a good solution. Do you want to create a pull request for this? |
Alternatively we could also allow the |
@alexander-schranz to which repository should I make the PR? |
Actual Behavior
When you have a page with multiple tabs with listviews, e.g. the
Automation
tab from the AutomationBundle and theData
tab from the FormBundle, the query parameters for sorting/filtering the lists are copied from one tab to the other.Therefore it can happen, that you are on the
Automation
tab, sort afterschedule
and then move to theData
tab, the request sent to the server has thensortBy=schedule
which ends in a 500, because theData
listview configuration does not have a columnschedule
.Expected Behavior
The request doesn't end in a 500 and returns the data with default sorting, ignoring the query parameters that define non-existing columns.
Steps to Reproduce
see above
Possible Solutions
Ignore query parameters that reference not existing columns
The text was updated successfully, but these errors were encountered: