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

Entry Versioning does not have correct order when version dateCreated is the same #2889

Closed
BenParizek opened this issue May 15, 2018 · 0 comments

Comments

@BenParizek
Copy link
Contributor

BenParizek commented May 15, 2018

Description

We are trying to import Entry Versions using our Sprout Import plugin. The import is successful but the versions display in the incorrect order in the Entry Version dropdown.

If our understanding is correct, we believe this is because the getVersionsByEntryId is ordering by dateCreated and all the versions are imported with the same dateCreated value.

Updating orderBy to num in the getVersionsByEntyId method seems to fix the issue but it may be best if someone that understands the full Entry Versions workflow confirm this is a good solution:

FROM

->orderBy(['dateCreated' => SORT_DESC])

TO

->orderBy(['num' => SORT_DESC])

Steps to reproduce

  1. Create multiple Entry Versions with the same dateCreated value
  2. View Entries in the CP and see they are in the incorrect order

Additional info

  • Craft version: 3.0.7
  • PHP version: 7.1
  • Database driver & version: MySQL
  • Plugins & versions: Sprout Import
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

No branches or pull requests

1 participant