?
avatar Didldu-Florian
Didldu-Florian
30 Mar 2016

Steps to reproduce the issue

The Article sorting does not work properly if subordinate Article are displayed at Category Blog Layout > Article Order > Recent First & Include Subcategories Aricles (See attached Screenshot debug_view.html.php.jpg (Tested by echo debuging > print display publish date as attached))

To test this event,

reproduce Article Dates, Category affiliation and Category tree as in attached screenshots please:
Articles must be assigned to different categories (See attached Screenshots articles and categories.jpg)
And menu component setting as attached (cat menu item.jpg) Tested by publishing date > Recent First
screen shot 2016-03-30 at 12 11 59 cat menu item!
screen shot 2016-03-30 at 12 12 09 debug_view.html.php!
screen shot 2016-03-30 at 12 12 10 articles and categories.jpg!

Expected result

Sorting as following
2016-03-27 14:42:38
2016-01-29 14:43:46
2016-01-27 14:44:52
2015-12-22 14:45:41
2015-12-21 14:46:24
2015-12-21 14:47:04
2015-12-06 14:48:08

Actual result

Sorting is confused as following
2016-01-29 14:43:46
2016-01-27 14:44:52
2015-12-21 14:46:24
2016-03-27 14:42:38
2015-12-21 14:47:04
2015-12-06 14:48:08
2015-12-22 14:45:41

System information

Tested on
Joomla 3.4.7 and 3.5.0 (Both blank installation with new content as attached, just modfied
components\com_content\views\category\view.html.php width echo debuging code snippet)

Apache 2.4.18
PHP 5.6.17 and 5.6.19
MySQL 5.7.10 and 5.6.15

Addition Notes:

By Sorting "Most Recent first" sorting ist confused mixed
By Sorting "Oldes first" sorting is correct.
(Quick n Dirty Bug Fix: Set Order to > Oldes First and change foreach to array_reverse()) ? !

avatar Didldu-Florian Didldu-Florian - open - 30 Mar 2016
avatar Didldu-Florian Didldu-Florian - change - 30 Mar 2016
The description was changed
avatar Didldu-Florian Didldu-Florian - change - 30 Mar 2016
The description was changed
avatar Didldu-Florian Didldu-Florian - change - 30 Mar 2016
The description was changed
avatar Didldu-Florian Didldu-Florian - change - 30 Mar 2016
The description was changed
avatar Didldu-Florian Didldu-Florian - change - 30 Mar 2016
The description was changed
avatar brianteeman
brianteeman - comment - 13 Apr 2016

It looks like something went wrong and most of your screenshots are missing.


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

avatar brianteeman brianteeman - change - 13 Apr 2016
Status New Information Required
avatar brianteeman brianteeman - change - 13 Apr 2016
Category Components
avatar brianteeman
brianteeman - comment - 13 Apr 2016

Sorry I misread your original post. I assumed the time and date in the sorting example was a screenshot name

avatar brianteeman brianteeman - change - 13 Apr 2016
Status Information Required New
avatar Webdongle
Webdongle - comment - 13 May 2016

@Didldu-Florian

In the Blog layout tab ... what setting is 'Category Order' ? If Global what is the Global setting for it ?


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

avatar Didldu-Florian
Didldu-Florian - comment - 13 May 2016

@Webdongle
Category Order is set to "Global" and Gloabl Order ist set to "Category Order"
To reproduce it, see attached screenshots above.

avatar Webdongle
Webdongle - comment - 14 May 2016

If you look at your results you should see that they are in order per category ?
Expected result Articles of first Category in date order then second Articles of the second Category in date order etc.
(i.e. it sorts by Category then by date order)

If you set the Category Order to 'No Order' then the Articles should be in date order regardless of Category.

avatar Didldu-Florian
Didldu-Florian - comment - 14 May 2016

@Webdongle nope, did not work. But it did work by oldes first when it is setting up by oldes article first!
This is confused to me.
As i see, it is a problem with sort function usort() and mutlidimensional array with certain numbers.

The more crazy confusion is, when i change Order to > Oldes First
and than do a hardcode change of sort function by
foreach to array_reverse()) than it works?

Please exactly reproduce my screenshots,
means exactly same category structure and same dates of articles, than you could see that problem.
It looks to me very strongly as a php usort() mutlidimensional array sort problem!

avatar AlexanderShilov
AlexanderShilov - comment - 28 May 2016

Hello! Sorry for my english. I think i solve that problem today. I just fill fields in blog category settings, like that:

Leading Articles - 0
Intro Articles - 20
Columns - 1

And it works! Articles sorting well

avatar brianteeman
brianteeman - comment - 4 Aug 2016

Is this still a problem? It is unclear from the conversation above if this is resolved?

avatar brianteeman brianteeman - change - 4 Aug 2016
Status New Information Required
avatar GESign
GESign - comment - 8 Aug 2016

I had this problem and finally after a few hours I realized that I have COPIED one article several times and those hsve the same CREATED dates. So it work only with newly created articles!


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

avatar brianteeman
brianteeman - comment - 8 Aug 2016

So it is working correctly. If the created date is the same then they can't
be sorted by the date

avatar GESign
GESign - comment - 8 Aug 2016

Yes, this was the problem at me and I think at several other guys as well.
Maybe the solution for this human mistake could be the copied article gets the current date. BUT in this case the publishing D/T could cause problem. So it is better to leave this as it is now.

avatar Didldu-Florian
Didldu-Florian - comment - 6 Sep 2016

@brianteeman Think this is a really special Problem, but it exists and should be solved.
@GESign the problem has nothing to do with copying articles. It exists after creation.

By Sorting "Most Recent first" sorting ist confused mixed
By Sorting "Oldes first" sorting is correct.

I´ve tested the fix below that helps for me. Sure, we can not implement this to Joomla.

So implement array_reverse() if order is "Most Recent first"
(ToDo: change foreach to array_reverse()) if order is "Most Recent first")

But it shows it must be a problem with sort function.

avatar joomlamarco
joomlamarco - comment - 4 Oct 2016

we testet this issue with florian in our JUG and there is no bug. the sorting works fine.
Tested on Database Version 5.5.5-10.1.13-MariaDB, php 7.0.6, Apache/2.4.18


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

avatar Didldu-Florian
Didldu-Florian - comment - 4 Oct 2016

JUP, that was a misunderstanding.
Tanks for testing @joomlamarco
I´ll Close the issue now!

avatar Didldu-Florian Didldu-Florian - change - 4 Oct 2016
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2016-10-04 17:14:43
Closed_By Didldu-Florian
avatar Didldu-Florian Didldu-Florian - close - 4 Oct 2016

Add a Comment

Login with GitHub to post a comment