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

ERATRANS-442: Fixed issue that makes sort applied to be overwritten by default bundle sort. #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vengador
Copy link

ERATRANS-442

Description

Fixed issue that makes sort applied to be overwritten by default bundle sort.

Change log

  • Fixed: Issue that makes sort applied to be overwritten by default bundle sort.

@@ -97,7 +97,7 @@ public function executeList(ListPageConfiguration $configuration): ?ListExecutio
// If we have a specific sort, we use that first, followed by the default
// bundle sort. Otherwise, just the bundle sort.
$sort = $sort ? [$sort['name'] => $sort['direction']] : [];
if ($bundle_sort) {
if ($bundle_sort && empty($sort)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR but there are some problems:

  1. There is no test that proves the issue.
  2. The fix is not correct. The issue that happens is that the overridden sort (not the bundle one) is for the same field as the default bundle sort, in which case it gets incorrectly overridden by the default bundle sort. If the field used is different, it's fine and it works as expected. Because then you have 2 sorts applied onto the query and that's what needs to happen. So the fix is not exactly correct because like this, if there is a sort override of a different field, the bundle default sort no longer applies as secondary sort. So please fix it so that both get applied if it's for 2 different fields. And add test please.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, we had an issue with the applied filters and default bundle in EFD.
I've created a PR for that. The case is when both sortings point to the same field, I'm not sure if is the same. I leave it here just in case:
#167

I haven't added tests yet

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.

3 participants