Feature RTC Performance PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar Denitz
Denitz
29 Aug 2023

Summary of Changes

Joomla\CMS\Language\Multilanguage::getSiteHomePages() uses an extra database query per each page load to discover the language-specific site homepages.

We can easily eliminate this extra database query and use the native SiteMenu::getItems().

Testing Instructions

Test a website with enabled multilanguage functionality and Joomla system caching enabled.

Actual result BEFORE applying this Pull Request

See an extra unoptimized SQL query per each page load:

SELECT `language`,`id` FROM `jos_menu` WHERE `home` = '1' AND `published` = 1 AND `client_id` = 0

Expected result AFTER applying this Pull Request

No extra SQL query, the homepages are discovered from the cached menu items.

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 - 29 Aug 2023
Category Libraries
avatar Denitz Denitz - open - 29 Aug 2023
avatar Denitz Denitz - change - 29 Aug 2023
Status New Pending
avatar Denitz Denitz - change - 29 Aug 2023
Labels Added: PR-4.3-dev
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2023
Category Libraries Unit Tests Repository Administration com_admin SQL
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2023
Category Unit Tests Repository Administration com_admin SQL Libraries
avatar Denitz Denitz - change - 22 Sep 2023
Title
Improve Multilanguage::getSiteHomePages()
[5.0] Improve Multilanguage::getSiteHomePages()
avatar Denitz Denitz - edited - 22 Sep 2023
avatar HLeithner
HLeithner - comment - 30 Sep 2023

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

avatar Denitz Denitz - change - 3 Oct 2023
Title
[5.0] Improve Multilanguage::getSiteHomePages()
[5.1] Improve Multilanguage::getSiteHomePages()
avatar Denitz Denitz - edited - 3 Oct 2023
avatar crommie crommie - test_item - 24 Feb 2024 - Tested successfully
avatar crommie
crommie - comment - 24 Feb 2024

I have tested this item ✅ successfully on 9ea35c7

Extra query has gone.


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

avatar viocassel viocassel - test_item - 26 Feb 2024 - Tested successfully
avatar viocassel
viocassel - comment - 26 Feb 2024

I have tested this item ✅ successfully on 9ea35c7


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

avatar Quy Quy - change - 29 Mar 2024
Status Pending Ready to Commit
avatar Quy
Quy - comment - 29 Mar 2024

RTC


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

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
[5.1] Improve Multilanguage::getSiteHomePages()
[5.2] Improve Multilanguage::getSiteHomePages()
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar richard67 richard67 - change - 12 May 2024
Labels Added: Feature RTC b/c break PR-5.2-dev
Removed: PR-4.3-dev
avatar rdeutz
rdeutz - comment - 15 May 2024

This was discussed at the maintainers meeting today. Please don't remove the parameter but make a depeciated message for the parameter so that we can remove it in one of the next versions. Beside this the change is approved. Thanks.

avatar Quy Quy - change - 22 May 2024
Status Ready to Commit Pending
avatar Denitz Denitz - change - 23 May 2024
Labels Added: Updates Requested
Removed: RTC
avatar Denitz
Denitz - comment - 23 May 2024

@rdeutz Done. Note that I can't add @deprecated attribute because it deprecates the whole method.

avatar Quy Quy - change - 23 May 2024
Labels Removed: Updates Requested
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] Improve Multilanguage::getSiteHomePages()
[5.3] Improve Multilanguage::getSiteHomePages()
avatar HLeithner HLeithner - edited - 2 Sep 2024
avatar rdeutz
rdeutz - comment - 29 Oct 2024

Tests are still valid the last change was only a doc block change

avatar rdeutz rdeutz - change - 29 Oct 2024
Labels Added: PR-5.3-dev
Removed: b/c break PR-5.2-dev
avatar HLeithner
HLeithner - comment - 4 Mar 2025

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

avatar HLeithner HLeithner - change - 4 Mar 2025
Title
[5.3] Improve Multilanguage::getSiteHomePages()
[6.0] Improve Multilanguage::getSiteHomePages()
avatar HLeithner HLeithner - edited - 4 Mar 2025
avatar Fedik Fedik - test_item - 23 Aug 2025 - Tested successfully
avatar Fedik
Fedik - comment - 23 Aug 2025

I have tested this item ✅ successfully on b22dc09


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

avatar Fedik Fedik - change - 23 Aug 2025
Status Pending Ready to Commit
avatar Fedik
Fedik - comment - 23 Aug 2025

I set it RTC, it seems was removed by accident and lost in time.


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

avatar richard67 richard67 - change - 23 Aug 2025
Labels Added: RTC PR-6.0-dev Performance
Removed: PR-5.3-dev
avatar brianteeman
brianteeman - comment - 23 Aug 2025

Is this still relevant as the code for multilingual home pages has changed since this PR was first created

avatar Fedik
Fedik - comment - 23 Aug 2025

Yes, method getSiteHomePages still there, and still in use.

avatar HLeithner
HLeithner - comment - 31 Aug 2025

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

avatar HLeithner HLeithner - change - 31 Aug 2025
Title
[6.0] Improve Multilanguage::getSiteHomePages()
[6.1] Improve Multilanguage::getSiteHomePages()
avatar HLeithner HLeithner - edited - 31 Aug 2025
avatar Denitz Denitz - change - 30 Oct 2025
Labels Added: PR-6.1-dev
Removed: PR-6.0-dev
avatar HLeithner HLeithner - change - 2 Mar 2026
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-03-02 15:44:00
Closed_By HLeithner
avatar HLeithner HLeithner - close - 2 Mar 2026
avatar HLeithner HLeithner - merge - 2 Mar 2026
avatar HLeithner
HLeithner - comment - 2 Mar 2026

Thanks, I skipped the deprecation for now, since it's not so important and we need to remove the usages first.

avatar Fedik
Fedik - comment - 5 Mar 2026

@Denitz I think we can be need to revert it, because ConsoleApplication does not have getMenu().
Can you please have a look?

Or maybe some extra check for instance of ConsoleApplication

avatar Denitz
Denitz - comment - 5 Mar 2026

@Fedik Good catch, here we go: #47310

I returned original code for non-CMSWebApplicationInterface instances because getMenu() is defined in this interface.

avatar HLeithner
HLeithner - comment - 6 Mar 2026

Actually @joomdonation found this issue.
As I wrote in your PR we will revert this and only keep the new code in the menu and deprecate the getSiteHomePages() and remove it in joomla 8.0. and rewrite all usages to the $menu->getHomepages() method.

Can you do this?

Add a Comment

Login with GitHub to post a comment