Install Multilingual Sample Data (English, French, German, Persian)
Under System > Content Languages, delete Persian.
Under Components > Multilingual Associations, select Articles and English (en-GB).
Under Associations and Not Associated columns, see error.
Notice: Undefined index: link in \layouts\joomla\content\associations.php on line 18
Labels |
Added:
?
|
This happens when the article has already a fa-IR associated item before the Content Language is trashed or deleted.
Elsewhere such as Content>Articles and Content>Categories, you don't get this notice under the Association
column. Should the badge for the trashed/deleted Content Language be displayed?
In the managers, we use HTMLHelper()
and the service files.
In com_associations we use getAssociationHtmlList()
These are very different methods.
I don't see where we would have a Trash for a Content Language deleted (Except in the multilingual status obviously where it already shows)
I guess the only solution would be to get an error message and prevent showing the items concerned in the associations columns, whether in com_associations or other components.
This implies changes in the layout and the xxxService.php
files.
Concerning other xxxService.php
than com_associations helper, I can get this: fa-IR associated items don't show in column and display a Warning (here an example for articles where we do have a fa-IR article associated to the en-GB one.)
Looking how I can do for com_associations.
Shall I make the patch?
Yes please.
I think it not only about deletion.
I have this issue also when I add a content language manually (without install language), without deletion anything.
so it available at index.php?option=com_languages&view=languages
but not exists at index.php?option=com_languages&view=installed
It sounds like com_associations looking on installed languages only or?
Hmm, normally (at least this was the concept when we started multilang) one is supposed to be able to work when a language is not yet installed by just creating the Content Language.
Will look at this.
@Fedik
Thanks for finding this.
When we only have a content language and no corresponding installed language:
No associations
columnI found why we have this issue:
$checkinstalled
is set to true per default in
https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Language/LanguageHelper.php#L365
therefore it will never display the Content Language if it does not have also an installed language...
This has consequences all over multilang joomla...
If I modify it to false
in the associations helper, it works fine for the manager at least (as Target is still missing the language in the side by side page, which I also can solve by adding a false
in ItemlanguageField
).
Same if I use false in the articleModel.
I propose to try to deal with this in another PR as I wonder if we should set the default to false
.
As it has no impact on this original issue, will make the PR for that.
Note: I also found a side problem concerning this issue (i.e. when a Content Language —with its Installed language OK— is trashed/deleted). When editing an item that was tagged to the trashed content language, the same language is still proposed in the Associations Tab. But I guess this would be taken care of with the new Warning.
Hmm, concerning $checkinstalled
, looks like we have the same issue in 3.x
I have been trying to find out when that was implemented to find the reason for it but I fail because history on github stops when the helper is moved to src
in 3.8.0
If I remember well @andrepereiradasilva was the one who originally created that method, but not sure.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-12-23 14:47:10 |
Closed_By | ⇒ | Quy |
Confirmed.