Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Improve Multilanguage::getSiteHomePages() #41507

Open
wants to merge 10 commits into
base: 5.2-dev
Choose a base branch
from

Conversation

Denitz
Copy link
Contributor

@Denitz Denitz commented Aug 29, 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

@Denitz Denitz changed the base branch from 4.3-dev to 5.0-dev September 22, 2023 06:47
@Denitz Denitz changed the title Improve Multilanguage::getSiteHomePages() [5.0] Improve Multilanguage::getSiteHomePages() Sep 22, 2023
@HLeithner HLeithner changed the base branch from 5.0-dev to 5.1-dev September 30, 2023 22:49
@HLeithner
Copy link
Member

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

@Denitz Denitz changed the title [5.0] Improve Multilanguage::getSiteHomePages() [5.1] Improve Multilanguage::getSiteHomePages() Oct 3, 2023
@crommie
Copy link

crommie commented Feb 24, 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.

@viocassel
Copy link
Contributor

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.

@bembelimen bembelimen added the b/c break This item changes the behavior in an incompatible why. HEADS UP label Mar 4, 2024
@Quy Quy added PR-4.3-dev and removed Feature b/c break This item changes the behavior in an incompatible why. HEADS UP PR-5.1-dev labels Mar 29, 2024
@Quy
Copy link
Contributor

Quy commented Mar 29, 2024

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 29, 2024
@Quy Quy added b/c break This item changes the behavior in an incompatible why. HEADS UP PR-5.1-dev Feature and removed PR-4.3-dev labels Mar 29, 2024
@HLeithner HLeithner changed the base branch from 5.1-dev to 5.2-dev April 24, 2024 09:08
@HLeithner
Copy link
Member

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

@HLeithner HLeithner changed the title [5.1] Improve Multilanguage::getSiteHomePages() [5.2] Improve Multilanguage::getSiteHomePages() Apr 24, 2024
@rdeutz
Copy link
Contributor

rdeutz commented May 15, 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.

@Quy Quy added Updates Requested Indicates that this pull request needs an update from the author and should not be tested. and removed Updates Requested Indicates that this pull request needs an update from the author and should not be tested. RTC This Pull Request is Ready To Commit labels May 15, 2024
@Denitz
Copy link
Contributor Author

Denitz commented May 23, 2024

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

@Quy Quy removed the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b/c break This item changes the behavior in an incompatible why. HEADS UP Feature PR-5.2-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants