joomla-cms
joomla-cms copied to clipboard
[5.2] Improve Multilanguage::getSiteHomePages()
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
This pull request has been automatically rebased to 5.1-dev.
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.
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.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41507.
This pull request has been automatically rebased to 5.2-dev.
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 Done. Note that I can't add @deprecated attribute because it deprecates the whole method.