[wp-trac] Re: [WordPress Trac] #6476: 2.5 Gallery shortcode orderby not working

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 2 13:08:06 GMT 2008


#6476: 2.5 Gallery shortcode orderby not working
---------------------------+------------------------------------------------
 Reporter:  GeoffHarrison  |        Owner:  anonymous
     Type:  defect         |       Status:  reopened 
 Priority:  normal         |    Milestone:  2.5.1    
Component:  General        |      Version:  2.5      
 Severity:  normal         |   Resolution:           
 Keywords:  has-patch      |  
---------------------------+------------------------------------------------
Comment (by markjaquith):

 Replying to [comment:18 Dickie]:
 > OK, but as far as I can see the orderby works fine (if the gallery works
 at all that is), If I change the orderby on my WAMP setup it changes the
 order nicely, (and yes RAND() is fun !!).
 >
 > Many people are saying the gallery is working fine, it's just a few of
 us will odd setups ( I think) and that is why I raised my initial ticket
 because my gallery function did not work at all on my hosting account. See
 #6508

 Hm, well if a quoted ORDER BY clause is working for some SQL setups, then
 we shouldn't break it.  On my SQL setup, it doesn't work:

 {{{
 mysql> select ID, post_name from wptrunk_posts ORDER BY "post_name DESC"
 limit 5;
 +----+----------------------+
 | ID | post_name            |
 +----+----------------------+
 | 32 | testing-123rwefwef   |
 | 24 | tag-post             |
 |  2 | about                |
 | 18 | another-barcamp-post |
 | 17 | at-barcamporlando    |
 +----+----------------------+
 5 rows in set (0.00 sec)

 mysql> select ID, post_name from wptrunk_posts ORDER BY "post_name ASC"
 limit 5;
 +----+----------------------+
 | ID | post_name            |
 +----+----------------------+
 | 32 | testing-123rwefwef   |
 | 24 | tag-post             |
 |  2 | about                |
 | 18 | another-barcamp-post |
 | 17 | at-barcamporlando    |
 +----+----------------------+
 5 rows in set (0.00 sec)

 mysql> select ID, post_name from wptrunk_posts limit 5;
 +----+----------------------+
 | ID | post_name            |
 +----+----------------------+
 | 32 | testing-123rwefwef   |
 | 24 | tag-post             |
 |  2 | about                |
 | 18 | another-barcamp-post |
 | 17 | at-barcamporlando    |
 +----+----------------------+
 5 rows in set (0.00 sec)
 }}}

 As you can see, both ASC and DESC quoted ORDER BY clauses are the same as
 having no ORDER BY clause.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6476#comment:20>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list