-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Remove multilanguage related db duplicate queries #8914
Remove multilanguage related db duplicate queries #8914
Conversation
…e-language-duplicate-queries
@@ -78,41 +78,28 @@ public static function getContentlangs() | |||
* Method to return a list of published site languages. | |||
* | |||
* @return array of language extension objects. | |||
* | |||
* @deprecated 3.6 Use JLanguageMultilang::getSiteLangs() instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deprecated 4.0
Always use the first version it may be removed from (so next major version), not the version it's deprecated in.
I get some Notices and Warning when the item has no associations yet. ( ! ) Notice: Undefined index: com_content|#__content|com_content.item|213|id|alias|catid in /ROOT/libraries/cms/language/associations.php on line 121 or with for example I can get rid of the Warning for example in the menus helper by checking if we do have associations:
But I still have the Notice.
|
sorry @infograf768 code was a problem, i willl fix it soon |
i think it's solved now, the bug was is line 47 andrepereiradasilva@167035f#diff-5ca4c28b8e63fb73e99b5128c808630fR47 (the variable name was wrong) |
…e-language-duplicate-queries solves conflict
I have tested this item ✅ successfully on b9d67c2 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8914. |
I have tested this item ✅ successfully on b9d67c2 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8914. |
I have tested this item ✅ successfully on b9d67c2 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8914. |
RTC then! |
Description
This PR, to remove duplicate queries from db, it saves into variables the result of the db queries of the two methods moved, only running the db query if needed.
Also moves some multilanguage methods from com_languages helper
MultilangstatusHelper
to JLanguage Multilang helperJLanguageMultilang
.Performance
This adds a little performance benefit. Around 2ms to 3ms of total page generation time (in a PHP 5.6 installation).
Before
After
How to test
ms
taken to do all database queries.Observations
Since this PR adds and deprecates some class methods, please say if anything else is needed to do.
Suggestions, code reviews and improvements are welcome.