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

Sort revisions by edit_date/rev_date desc #87

merged 4 commits into from Feb 1, 2019


None yet
2 participants
Copy link

HopStudios-Development commented Jan 11, 2019


Users are more likely to want to compare and work with recent revisions than older ones. Therefore, the revisions list should start with the most recent revisions (the same way that the entries list shows recent entries and the file list show recent files).

Resolves #NN.

Nature of This Change

  • 🐛 Fixes a bug
  • [x ] 🚀 Implements a new feature
  • 🛁 Refactors existing code
  • 💅 Fixes coding style
  • Adds tests
  • 👽 Adds new dependency
  • 🔥 Removes unused files / code
  • 🔒 Improves security

Is this backwards compatible?

  • [x ] Yes
  • No


User Guide Pull Request:

Copy link

derekjones left a comment

Good suggestion, @HopStudios-Development. Do you think it would be better to sort by rev_date by default though? If revisions are manually migrated or inserted out of order by an add-on or similar, it's possible that those auto_increment primary keys will not be in chronological order.

It looks like that is happening here, but just in ascending order.

HopStudios-Development added some commits Jan 29, 2019

Update Template.php
Order template revisions by item_date desc

This comment has been minimized.

Copy link
Contributor Author

HopStudios-Development commented Jan 29, 2019

@derekjones I have updated the code based on your suggestions. Please note that I only changed the logic to sort the revisions by edit date or revision date. Please let me know your feedback. Thanks

@HopStudios-Development HopStudios-Development changed the title Sort revisions by rev_id desc Sort revisions by edit_date/rev_date desc Jan 29, 2019

Simplify use of counter
Using count + 1 rather than muting the counter up and back down within the conditional

This comment has been minimized.

Copy link

derekjones commented Feb 1, 2019

Thanks @HopStudios-Development I made a tiny change to the logic but this looks good. Thanks for carrying it over to entry versions as well!

@derekjones derekjones merged commit 2751eef into ExpressionEngine:stability Feb 1, 2019

0 of 2 checks passed

ci/circleci: test_php_56 CircleCI is running your tests
ci/circleci: test_php_71 CircleCI is running your tests

derekjones added a commit that referenced this pull request Feb 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.