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 element re-ordering #2028

Merged
merged 2 commits into from
Feb 16, 2021
Merged

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Feb 16, 2021

What is this pull request for?

Reverts c9b1c68 as this messed the element order by using the arbitary order
that the SQL query we initiated provides.

Fixed by keeping with the order of element ids from the params. This is slightly slower, but keeps the order correct.

Refactored the test in that it now creates the elements upfront in the correct order and then explicitely compares the
position afterwards.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

Reordering elements does not need to change the elements page id anymore
since we removed the trash.

This time we do not change the order of the element ids passed via the params.
To verify I updated the test so that the elements get created upfront and
the order is explicitely assured.
@tvdeyen tvdeyen added this to the 6.0 milestone Feb 16, 2021
Copy link

@dividedharmony dividedharmony left a comment

Choose a reason for hiding this comment

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

Thomas and I paired on how the original bug worked and how this commit fixes it. Looks good! 👍

@tvdeyen tvdeyen merged commit fd44a1d into AlchemyCMS:main Feb 16, 2021
@tvdeyen tvdeyen deleted the fix-element-reordering branch February 16, 2021 16:23
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.

2 participants