No Code Attached Yet
avatar HLeithner
HLeithner
22 Jul 2021

Steps to reproduce the issue

Create a menuitem of type "List All Categories in an Article Category Tree"
Change "Blog Layout" -> "Category Order" to "Title Alphabetical"

Expected result

Categories are sorted by title

Actual result

Categories are still sorted by ordering (or at least I think it's ordering)

System information (as much as possible)

4.0-rc4

Additional comments

avatar HLeithner HLeithner - open - 22 Jul 2021
avatar joomla-cms-bot joomla-cms-bot - change - 22 Jul 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Jul 2021
avatar joomdonation
joomdonation - comment - 23 Jul 2021

At first, I thought this would be easy to fix by providing an order by providing an order by option to Joomla\CMS\Categories\Categories class instead of hard code order by clause by c.lft (ordering) https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Categories/Categories.php#L297 . Sadly, that won't work. Look like categories needs to be ordered by ordering like that to have the categories tree built properly

So look like the only way to implement this ordering setting is using usort function to sort the data before it is displayed (doing that in the layout or inside the Categories model). Not sure if it is something which we should try to implement.

avatar chmst
chmst - comment - 23 Jul 2021

@HLeithner @joomdonation Just tested in a J3.9 and it did not work there either. Or am I missing something?

avatar joomdonation
joomdonation - comment - 24 Jul 2021

@chmst Looking at our current code, I would say that this feature never worked !

avatar brianteeman
brianteeman - comment - 24 Jul 2021

The option you refer to is not for changing the order of the categories on the first page of this menu item,

Change "Blog Layout" -> "Category Order" to "Title Alphabetical"

These options are also used when you select one of the category links, on the first page and/or thereafter, unless they are changed for a specific menu item.

image

avatar joomdonation
joomdonation - comment - 24 Jul 2021

@brianteeman Shouldn't the order (if could be implemented) be applied for categories from all of these layouts? I mean it should be moved to Shared tab, same with in component Options

component_options

Anyway, from what I see from the code, we don't handle this parameter in our code.

avatar brianteeman
brianteeman - comment - 24 Jul 2021

i am still trying to work out how you use the blog and list layouts

avatar joomdonation
joomdonation - comment - 24 Jul 2021

Sorry, I don't understand your last comment.

avatar chmst
chmst - comment - 26 Jul 2021

Yesterday I spent a huge amount of time with this issue.
What I think now: The categories are displayed as a tree. No ordering is here possible and never was possible.

The categories which are shown in this tree are links to a category blog.
The whole bunch of params determines how this category blog is built. The ordering of articles, columns and so on.

Maybe this issue is not an issue but expected behaviour? Maybe I am missing something.

avatar joomdonation
joomdonation - comment - 26 Jul 2021

You're right that it never was possible. However, it is still a bug. When you have that parameter set to a custom order, users would expect that categories in the list follow that custom order. Right now, it is always ordered by ordering, and that's not what people expect to see (assume they use that parameter).

avatar brianteeman
brianteeman - comment - 26 Jul 2021

From my understanding there are several different but related issues here.

  1. There is no ability to sort the categories listed on the first page
  2. Links from the first page go to a blog view and use the settings in the blog tab
  3. the list view tab is never used at all
avatar joomdonation
joomdonation - comment - 26 Jul 2021

Regarding your finding #2 and #3: What layout used when users click on a category from first page (List/Blog) is determined in the component options (a bit strange that we do not allow determining that layout parameter from the menu item setting like other parameters)

component_options

avatar brianteeman
brianteeman - comment - 26 Jul 2021

ah ok thanks for the explanation.

So to rewind back to the original report. @HLeithner was changing a setting in the blog tab expecting it to change the order on the front page but this was the wrong option.

However the correct option to sort the categories which should be in the categories tab is missing

avatar joomdonation
joomdonation - comment - 26 Jul 2021

Actually, when you click on a category from the first page, that category could contains sub-categories and these sub-categories can be displayed on category page, too

So that sorting option should be carried out to category page, too. In short, the setting should be in Shared tab (same with in Component options)

But that setting never worked, and there is no nice way to solve it using SQL query (at least from what I see), I wonder if we really need to find a way fix it (we can already control ordering of categories by ordering anyway).

avatar chmst
chmst - comment - 26 Jul 2021

I see no possibility via sql.
It is a challenge and I don't know how to resolve it except catching the whole tree and rebuild it in the view with correct ordering.

avatar joomdonation
joomdonation - comment - 22 Nov 2022

Looking at this issue again, I see that the parameter here is used to control ordering of children categories of a category, not ordering of the categories on the first page. And for that, we already have it works as expected already (except that it is not locale aware as reported here #28643 )

So I would say that this issue is invalid and will close it in the next days if no-one against it.

avatar joomdonation joomdonation - close - 4 Dec 2022
avatar joomdonation
joomdonation - comment - 4 Dec 2022

Closing as stated in my comment above #34866 (comment)

avatar joomdonation joomdonation - change - 4 Dec 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-12-04 07:31:01
Closed_By joomdonation
Labels Added: No Code Attached Yet
Removed: ?

Add a Comment

Login with GitHub to post a comment