Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Refactoring helper of mod_languages #5952
This speeds up the helper of mod_languages a bit and reduces the amount of code.
Line 40-49: Instead of cycling through all menu items and checking each if it is a home menu item, we are cycling through all languages (which should be a lot less than the menu items) and only retrieve the home menu item per language.
Line 64 + 65: The option parameter in Joomla only allows ASCII characters and class names are case insensitive. At the same time, JPATH_COMPONENT_SITE is already sanitized and does not need to be sanitized again. This could prevent loading JString unnecessarily.
Line 106: All links have to be processed by JRoute, regardless of SEF URLs being enabled or not.
Line 110: We are already checking if the currently processed language is the currently active language. We can use that result and thus remove the call in former line 75.
Line 114ff: The Itemid of a home menu item is always removed and thus we don't need a special case for SEF/non-SEF URLs.
referenced this pull request
Feb 2, 2015
upgraded from 3.3.6 to 3.4 beta3, with 5952 the side effect is the UK flag is now displayed on all FrontEnd pages when it was not the case in 3.3.6.
Use case below.
I've only 1 unpublished article in English (that says: site not avail in English) to cover the unprobable case someone tries /index.php/en
With 5952 , /index.php/en returns a 404 while 3.3.6 return the "site not avail in English" article.
Forgot to say that I do not get a 404 here (which is the correct way to do things) because I had a category and an article published both tagged to that content language without home page.