Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

versions list order

edited September 2014 in Apps

It seems that the versions list doesn't show the last timestamp/user.

I think the problem is in "history" function of "Versions" model that make a query like

select * from versions where class='[selected_class]' group by pkey order by ts desc

maybe this could be something like

select * from versions where id in (select max(id) from t_versions where class='[selected_class]' group by pkey) order by ts desc

Do you agree?


  • Do you mean that the author shows as 'Nobody' on the oldest version of the 'index' page or 'members' block? Those versions are added during the install process, so they're missing a user to assign them to, but otherwise it seems to be showing the info correctly from what I can tell.

  • No, I mean that in the main list of versions (/admin/versions) I expect to see, next to each id, the last modification date and its author.

    With the current query that does not always seem true.

  • Can you show an example of an incorrect date/author on an object? I've been playing around with it and it seems to always show me the correct info as far as I can tell.

  • I just sent you two screenshots.

  • Hmm, I do see the problem in your screenshots, but mine keeps showing it correctly. Just working on reproducing it today.

  • Running the two queries above are returning identical output for me. Still digging... :)

  • I'll have to test your suggested query across SQLite/MySQL/PostgreSQL next.

  • Just pushed a fix that incorporates your query. Was confused about why the databases were sorting differently, but in the end your query fixes it across all anyway :)

  • Thank you Johnny! I think the db returns the records in the fastest way. If the query does not contain a "order by" clause, it might return them not sorted. The fact that they are sorted in your db is just a coincidence; inserting and then deleting records could change the result (without "order by").

Sign In or Register to comment.