joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.2] Improve Multilanguage::getSiteHomePages()

Open Denitz opened this issue 2 years ago • 6 comments

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:

  • [x] No documentation changes for docs.joomla.org needed

  • [ ] Pull Request link for manual.joomla.org:

  • [x] No documentation changes for manual.joomla.org needed

Denitz avatar Aug 29 '23 06:08 Denitz

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

HLeithner avatar Sep 30 '23 22:09 HLeithner

I have tested this item :white_check_mark: successfully on 9ea35c728b4e85fe9def8476aa0be51902f30265

Extra query has gone.


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

crommie avatar Feb 24 '24 13:02 crommie

I have tested this item :white_check_mark: successfully on 9ea35c728b4e85fe9def8476aa0be51902f30265


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

viocassel avatar Feb 26 '24 21:02 viocassel

RTC


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

Quy avatar Mar 29 '24 20:03 Quy

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

HLeithner avatar Apr 24 '24 09:04 HLeithner

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.

rdeutz avatar May 15 '24 18:05 rdeutz

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

Denitz avatar May 23 '24 18:05 Denitz