User tests: Successful: Unsuccessful:
Ref: http://forum.joomla.org/viewtopic.php?f=711&t=880812
Set a multilingual site with associations.
Set Remove Language Code to Yes in the languagefilter plugin
Load a page with associations in another language than the site default language.
The alternate for the site default language in source will display the sef prefix.
This is wrong.
the error comes from the code introduced in #5140:
$this->default_lang;
is not the default site language but the present language in use.
Patch and test again.
NOTE: when looking at this specific issue, I remarked:
1. line 619 is also using $this->default_lang;
for the site default language. I corrected it.
Labels |
Added:
?
|
Milestone |
Added: |
one test OK here: http://forum.joomla.org/viewtopic.php?f=711&t=880812&p=3285327#p3285274
Works like a charm! Thank you for your quick response. :-)
@test: Tested with success.
Before patch:
1. Home pages without associations have no alternate links
2. Page in other language than the site default language with associations have alternate to default language with language prefix (directory, e.g. "en/") in the URL.
After patch:
1. Home pages without associations have all alternate links
2. Page in other language than the site default language with associations have alternate to default language without language prefix in the URL.
@infograf768 Remark:
The change made with this patch might make some code refactoring useful for performance reasons: The associations (assocs) array is not used when being on a home page, it is only used when being on a non home page and having associations switched on, and so it might be possible to move reading the associations into this "elseif ($this->params->get('item_associations'))" block which is coming after the home pages "if" block.
@infograf768 Forget my remark from my test above regarding optimization of code. I have had a deeper look into it meanwhile Better leave it as it is (with this PR here applied of course).
Status | Pending | ⇒ | Ready to Commit |
Category | ⇒ | Multilanguage |
@richard67
As we first check for home pages, even if someone has associated home pages, the first check takes care of it for alternate links and does not take into account the association, preventing a double alternate.
Thanks for testing.
2 good test. Setting RTC.
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-03-25 10:33:07 |
Added, as in 3.3.6, automatic alternate for Home Pages even when not associated.