User tests: Successful: Unsuccessful:
Pull Request for Issue #27236 (comment)
Since the beginning of the multilingual feature in Joomla, it was designed to be able to prepare a site with a Content Language even if the site corresponding language was not yet installed.
This has been broken by forcing $checkInstalled
to be true in https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Language/LanguageHelper.php#L365 (3.7.0)
and using true
in other places where the getContentLanguages()
method is used.
It may have been necessary at the time, but afaik it is useless now and breaks the feature.
This PR sets $checkInstalled
to false
by default and modifies to false
the instances where true
is used.
Install a multingual site with the multilingual sample data.
Create a new Content Language without its site Language. Let's use for example pt-PT for the demo
Create category and content (article, menus, categories, newsfeeds, contacts), tagged to the Content Language: no problem with that.
Edit an item NOT tagged to the pt-PT Content Language, switch to the Associations tab.
pt-PT will not display.
Display the Multilingual Associations component: same result, pt-PT will not display.
Patch and test again
After patch, test that all works fine in frontend. pt-PT should not display in the module switcher, etc.
All goes fine.
Example: Portuguese (pt-PT) displays fine in Associations Tab:
It may need a change indeed if there is a doc about it...
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_categories com_contact com_content com_menus com_newsfeeds Libraries |
I have tested this item
Labels |
Added:
?
|
Note: com_mails
may be considered as a specific case where true
has to be used if the code remains as is... But the original creator of this component refused to accept my input.
I still think that getContentLanguages()
is the wrong method to use there if the site is not multilingual.
It should use getInstalledLanguages()
and not display flags but badges with the language tag.
If the site is multilingual, it could use getContentLanguages()
with true
added i.e. making sure the corresponding language is installed.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Test result of Fedik was still valid because commits after his test were just updates to 4.0-dev without any changes on this PR.
Status | Ready to Commit | ⇒ | Pending |
Back to pending due to review comment here: #27341 (comment)
I have not tested this item.
Will change tomorrow
Then I will test tomorrow ;-)
Category | Administration com_categories com_contact com_content com_menus com_newsfeeds Libraries | ⇒ | Administration com_associations com_categories com_contact com_content com_menus com_newsfeeds Libraries |
@Fedik @richard67 @HLeithner
Modified in order to not change the library.
Please test again.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-12-28 13:11:22 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
Thanks
thanks for fix, I will test this evening