Soma Posted March 11, 2015 Share Posted March 11, 2015 I'm not sure and in a hurry Link to comment Share on other sites More sharing options...
kongondo Posted March 11, 2015 Share Posted March 11, 2015 From previous experience (and have also just now quickly tested), as long as the subfield is a db column name, it should work...so.. $items = $pages->find("sort=parent.title, limit=50"); will not work...you will get an error about column not found...but... $items = $pages->find("sort=parent.name, limit=50"); will work... 1 Link to comment Share on other sites More sharing options...
ESRCH Posted March 11, 2015 Share Posted March 11, 2015 Sorting by subfields is now supported (see https://github.com/ryancramerdesign/ProcessWire/pull/862). It was my first contribution, so I'm pretty proud 11 Link to comment Share on other sites More sharing options...
kongondo Posted November 9, 2015 Share Posted November 9, 2015 Just to clarify, according to Ryan's commit and comment and ESRCH PR, this only applies to FieldtypePage. Unless am missing a trick, the below still doesn't work $items = $pages->find("sort=parent.title, limit=50"); Link to comment Share on other sites More sharing options...
bracketfire Posted May 8, 2018 Share Posted May 8, 2018 I'm running 2.5.3 and hitting an error when trying to sort like this: sort=facility_page.title,sort=end_datetime using the title of a subfield, and getting back Column not found: 1054 Unknown column '_sort_page_facility_page_title.title' in 'order clause' It looks like the fix ESRCH references in this post will fix it. But I'm too much of a noob to figure out which release I need to upgrade to for the fix. Can someone smarter than me look it up? Link to comment Share on other sites More sharing options...
dragan Posted May 8, 2018 Share Posted May 8, 2018 Your installed PW version is from October 2014, while this fix / addition was a few months later. So I'd suggest to move up to 2.7. I recently upgraded an old site from 2014 to PW3 latest dev, and I didn't have to change that much. Mainly updating modules (or simply adding PW3 namespaces). Of course, with a live site, do it locally first. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now