?
avatar Quy
Quy
10 Dec 2019

Steps to reproduce the issue

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.

Actual result

Notice: Undefined index: link in \layouts\joomla\content\associations.php on line 18

avatar Quy Quy - open - 10 Dec 2019
avatar joomla-cms-bot joomla-cms-bot - change - 10 Dec 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Dec 2019
avatar infograf768
infograf768 - comment - 11 Dec 2019

Confirmed.

avatar infograf768
infograf768 - comment - 11 Dec 2019

This happens when the article has already a fa-IR associated item before the Content Language is trashed or deleted.

avatar Quy
Quy - comment - 21 Dec 2019

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?

avatar infograf768
infograf768 - comment - 22 Dec 2019

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.)

Screen Shot 2019-12-22 at 08 19 40

Looking how I can do for com_associations.

avatar infograf768
infograf768 - comment - 22 Dec 2019

For com_associations, we would get
Screen Shot 2019-12-22 at 09 13 46

avatar infograf768
infograf768 - comment - 22 Dec 2019

Shall I make the patch?

avatar Quy
Quy - comment - 22 Dec 2019

Yes please.

avatar Fedik
Fedik - comment - 22 Dec 2019

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?

avatar infograf768
infograf768 - comment - 22 Dec 2019

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.

avatar infograf768
infograf768 - comment - 22 Dec 2019

@Fedik
Thanks for finding this.
When we only have a content language and no corresponding installed language:

  1. We can tag an item to this content language. That part works fine.
  2. The problem exists indeed in com_associations: the target choice will not propose that Content Language language and it is not displayed in the No associations column
  3. The language is not proposed in the Associations Tab when editing an item

I 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.

avatar infograf768
infograf768 - comment - 23 Dec 2019

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.

avatar infograf768
infograf768 - comment - 23 Dec 2019

The PR was #12344 (tks @Bakual for helping me find it.)
I must say that I never tested the case at the time...
As stated above, will try to look at it later.

avatar Quy Quy - change - 23 Dec 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-12-23 14:47:10
Closed_By Quy
avatar Quy
Quy - comment - 23 Dec 2019

See PR #27340 & #27341

avatar Quy Quy - close - 23 Dec 2019

Add a Comment

Login with GitHub to post a comment