Feature Language Change PR-5.0-dev PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar charvimehradu
charvimehradu
8 Aug 2023

Pull Request for Issue #39532 .

Summary of Changes

  1. Create a field to set the ordering of the categories in the backend.
  2. Add the functionality to order the categories according to the order by query in the database: To determine the ordering for the database query, include the getCategoryOrdering method. The desired category ordering preference is fetched in the getChildrenCategories method, a SQL query is built based on this preference, and the resulting order is used to sort and restructuring the array of child categories. The resulting array $orderedChildrenCategories will contain the children categories sorted as per the Joomla database query order.

Testing Instructions

  • Create different categories and assign them a parent category. (Menu -> Content-> Categories -> New)
  • Move to site modules and add Articles Categories Module (New -> Articles Categories +). Select Parent Category and find the option for Category Ordering just below it and set according to your choice.

image

  • Save the module.

Actual result BEFORE applying this Pull Request

No option to order the categories.

Expected result AFTER applying this Pull Request

You are able to order the categories according to their title and lft values.

f2edf16a-d6ef-4c2b-bd75-0439a652ed42.mov

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed
avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2023
Category Language & Strings Modules Front End
avatar charvimehradu charvimehradu - open - 8 Aug 2023
avatar charvimehradu charvimehradu - change - 8 Aug 2023
Status New Pending
avatar charvimehradu charvimehradu - change - 8 Aug 2023
Labels Added: Language Change PR-4.4-dev
avatar HLeithner
HLeithner - comment - 9 Aug 2023

thanks for your pull request, but I think that sorting should be in the categories service and not in the module helper. Also the target branch should be 5.0.
@laoneo what do you think?

avatar charvimehradu charvimehradu - change - 11 Aug 2023
Labels Added: Feature
avatar charvimehradu
charvimehradu - comment - 11 Aug 2023

Hi, @HLeithner thank you for taking the time to review my pull request. I'll wait for your confirmation on the services part since I don't know it well. In the meantime, I've updated the branch to 5.0 as you recommended. Please let me know how you'd like to proceed.

avatar rachelwalraven rachelwalraven - test_item - 26 Aug 2023 - Tested successfully
avatar rachelwalraven
rachelwalraven - comment - 26 Aug 2023

I have tested this item ✅ successfully on 33d9d66

Tested on Joomla 4.4 with PHP 8.1.22


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

avatar charvimehradu charvimehradu - change - 3 Sep 2023
Labels Added: PR-5.0-dev
Removed: PR-4.4-dev
avatar richard67 richard67 - alter_testresult - 8 Sep 2023 - rachelwalraven: Tested successfully
avatar ceford ceford - test_item - 9 Sep 2023 - Tested successfully
avatar ceford
ceford - comment - 9 Sep 2023

I have tested this item ✅ successfully on 453d1dd

Tested on 5.0.0-beta2-dev - it works as described and makes sense to have Categories in Alpha order. No comment on whether this is the right place for this feature.


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

avatar richard67
richard67 - comment - 19 Sep 2023

@HLeithner As you moved this PR to draft: Shall we reopen the issue #39532 ?

avatar HLeithner
HLeithner - comment - 19 Sep 2023

I change it to draft so it's not merged by accident, I'm not happy with the solution but I think it can be improved. In addition I don't have the time to do this before 5.0.0 release I want to postpone it to maybe 5.1

avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 5.1-dev.

avatar crimle crimle - test_item - 24 Feb 2024 - Tested successfully
avatar crimle
crimle - comment - 24 Feb 2024

I have tested this item ✅ successfully on 453d1dd


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

avatar HLeithner
HLeithner - comment - 24 Apr 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Add the function to order the categories
[5.2] Add the function to order the categories
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar Hackwar Hackwar - change - 22 Jul 2024
Labels Added: PR-5.2-dev
avatar brianteeman
brianteeman - comment - 22 Jul 2024

As Joomla 5.2 will have the new articles module that offers this functionality (and more) shouldnt we just close this and leave this module as it is

avatar bascherz bascherz - test_item - 24 Aug 2024 - Tested successfully
avatar bascherz
bascherz - comment - 24 Aug 2024

I have tested this item ✅ successfully on 749bfaf

Works pretty much as expected, however I don't see any difference between Category Order and No Order. Nice feature. Good job!


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

avatar HLeithner
HLeithner - comment - 2 Sep 2024

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 2 Sep 2024
Title
[5.2] Add the function to order the categories
[5.3] Add the function to order the categories
avatar HLeithner HLeithner - edited - 2 Sep 2024

Add a Comment

Login with GitHub to post a comment