Jump to content

2.6.16 publish date: Not yet in sort selector?


Recommended Posts

Posted

Hello,

my client wants to schedule his posts and since I haven't had any issues with 2.6.16 in development I decided to update his site to the dev version in order to use "publish" date. The DB was properly updated, "published" shows up in the pages table, I can use $page->published but $pages->find("sort=-published") doesn't seem to work. Is this correct or am I missing something?

Thanks,

thomas

Posted (edited)

Haven't looked into the implementation yet but you are right; it seems not to be working. However, sorting the PageArray itself works for me, i.e.

$pages->find('template=basic-page')->sort('-published');

Not exactly what you are after, but just thought to point that out...

Edited by kongondo
Clarified post
Posted

It does? For me it definitely doesn't. I use $pages->find("template=article,sort=-published,limit=3") and it sorts by created. No matter if I use "published" or "-published". I use 2.6.17 now btw

Posted

Look at my code...that's an in-memory sort (i.e. the sort is happening outside the database, after the items have already been fetched). In other words, and I should have been clearer, sort within the selector is not working for me either, just as you described  :-)

Posted

Ah, alright. Thanks for the clarification. You are right, that's not exactly what I'm looking for since I need to pick the latest 3 articles from 2354 ... 

  • 1 year later...
Posted
7 minutes ago, Neo said:

now

Sorting by published works for the last two years or so. (Not sure about before that or about PW 2.6 though)

$pages->find('template=MyTemplate, limit=15, sort=-published') 

most certainly works.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...