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

Avoid trying to load a module's language file multiple times #11698

Merged
merged 1 commit into from
Aug 22, 2016
Merged

Avoid trying to load a module's language file multiple times #11698

merged 1 commit into from
Aug 22, 2016

Conversation

mbabker
Copy link
Contributor

@mbabker mbabker commented Aug 20, 2016

Summary of Changes

Depending on how many times a module gets used on a page, its language files may attempt to be loaded multiple times. Because of the internal loading of the default language, depending on where a language file is located the load method will go through at least a couple of loops resulting in a bunch of extra processing. Example:

screen shot 2016-08-20 at 4 43 29 pm

By checking if the files have been loaded first, we can cut back on the number of loops that get made here. Example:

screen shot 2016-08-20 at 4 46 48 pm

### Testing Instructions

The module's language files are still loaded correctly.

Documentation Changes Required

N/A

@andrepereiradasilva
Copy link
Contributor

I have tested this item ✅ successfully on a5ecc9a

works as described


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

@Fedik
Copy link
Member

Fedik commented Aug 22, 2016

I have tested this item ✅ successfully on a5ecc9a


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

@zero-24
Copy link
Contributor

zero-24 commented Aug 22, 2016

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 22, 2016
@rdeutz rdeutz added this to the Joomla 3.6.3 milestone Aug 22, 2016
@rdeutz rdeutz merged commit 955041f into joomla:staging Aug 22, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 22, 2016
@mbabker mbabker deleted the dupe-module-load-languages branch August 22, 2016 20:13
@infograf768
Copy link
Member

@mbabker
Regression: seee #11812

@infograf768
Copy link
Member

Maybe we need to chnage to
if (!$lang->getPaths($module->module || $app->isAdmin())) ?

@mbabker
Copy link
Contributor Author

mbabker commented Aug 27, 2016

Not an acceptable fix. It basically says "always load language files for an extension on the admin app, regardless of if loaded or not". The whole point of this was to reduce the number of times we're calling JLanguage::load() when an extension has already been loaded.

roland-d pushed a commit to roland-d/joomla-cms that referenced this pull request Sep 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants