? Success
Pull Request for # 6489

User tests: Successful: Unsuccessful:

avatar AndyGaskell
AndyGaskell
18 Mar 2015

Change to make the secondary ordering consistent and more useful. Related to #6489.

I'm not really sure if this is a bug, but to me it looks like a sub-optimal behavior, from a conceptual point of view. It is really, how the articles are sorted, in addition to the option chosen by the user.

Steps to reproduce the issue

  1. Create three articles, "article 1", "article 2" and "article 3", created in that order.
  2. Set the "Article Manager Options", under the "Shared Options" tab, set the "Article Order" to "Ordering".
  3. In the front end, view a "Articles » Category List" page.
  4. You'll see the articles are in the order "article 1", "article 2" then "article 3".

Expected result

This is maybe a subtlety, but although I set the list to sort by ordering, if all items have the same "ordering" value, I would expect the newest to be at the top. So they would be listed as "article 3", "article 2" then "article 1".

Actual result

You'll see the articles are in the order "article 1", "article 2" then "article 3".

System information (as much as possible)

PHP Built On Linux penguin.directrouter.co.uk 2.6.32-531.23.3.lve1.2.66.el6.x86_64 #1 SMP Fri Sep 12 10:57:40 EDT 2014 x86_64
Database Version 5.6.23
Database Collation latin1_swedish_ci
PHP Version 5.4.38
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 3.4.0 Stable [ Ember ] 24-February-2015 23:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0

Additional comments

I realize this is quite a subtle one, but it seemed worth mentioning. It is a one-line fix in the code, which I'd be happy to submit.

To a degree it would resolve an inconsistency. There are other areas where "created DESC" is used, so the behavior described above seems an anomaly.

Examples of "created DESC" being used can be found at...

components/com_content/models/featured.php
Line 130: $orderby = $primary . ' ' . $secondary . ' a.created DESC ';

components/com_content/models/archive.php
Line 84: $orderby = $primary . ' ' . $secondary . ' a.created DESC ';

But the code that causes this to be different is...

components/com_content/models/category.php
Line 312: $orderby .= $primary . ' ' . $secondary . ' a.created ';

So, there is an argument that this is a bug because within "components/com_content" this is the odd-one-out.

avatar AndyGaskell AndyGaskell - open - 18 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 18 Mar 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 21 Mar 2015
The description was changed
Rel_Number 6489
Relation Type Pull Request for
avatar phproberto
phproberto - comment - 21 Mar 2015

I have edited the PR to add #6489 information

avatar infograf768
infograf768 - comment - 21 Mar 2015

I can't replicate the issue here. I do get article 3 then 2 then 1.

@AndyGaskell
Maybe unrelated, but your database is not collated as should: it should be utf8 and not latin Swedish
You can use a tool to correct the db and eventually the tables:
http://www.phoca.cz/download/category/17-phoca-changing-collation-tool

avatar zero-24 zero-24 - change - 21 Mar 2015
Status Pending Information Required
avatar zero-24 zero-24 - change - 22 Mar 2015
Category Components
avatar AndyGaskell
AndyGaskell - comment - 23 Mar 2015

@infograf768 Thanks for the note Jean-Marie, I think phpMyAdmin installed on my ubuntu dev machine with the wrong package, so was doing this for a while. I think this is unrelated to the bug, but I'll check.

I was sad to read you "Every adventure has an end" post last month, thank you for all your help and contributions over the years, you're a giant among giants.

avatar AndyGaskell
AndyGaskell - comment - 26 Mar 2015

I've found a bug in this fix that causes an error in some use cases.

I think the issue is still valid, but this fix is not a good one.

avatar brianteeman
brianteeman - comment - 23 Apr 2015

@AndyGaskell have you found a "good" fix or shall I close this issue for now


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6490.

avatar brianteeman
brianteeman - comment - 21 Jun 2015

After several months without update I am closing this at this time. It can always be reopened at a later date


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6490.

avatar brianteeman brianteeman - change - 21 Jun 2015
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2015-06-21 10:31:02
Closed_By brianteeman
avatar brianteeman brianteeman - close - 21 Jun 2015

Add a Comment

Login with GitHub to post a comment