No Code Attached Yet bug
avatar peterhulst
peterhulst
18 Sep 2023

Steps to reproduce the issue

  • Have all content languages unpublished
  • Enable the plugin language filter with default settings
  • Site language en-GB

Expected result

Correct display website display

Actual result

A lot of warnings:
Warning: Undefined array key "en-GB" in ...\plugins\system\languagefilter\languagefilter.php on line 226
Warning: Attempt to read property "sef" on null in ...\plugins\system\languagefilter\languagefilter.php on line 226

System information (as much as possible)

Joomla 4.3.4
PHP 8.0.28, PHP 8.1.23

Additional comments

When disable the plugin language filter the warnings disappear.

avatar peterhulst peterhulst - open - 18 Sep 2023
avatar joomla-cms-bot joomla-cms-bot - change - 18 Sep 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Sep 2023
avatar peterhulst peterhulst - change - 18 Sep 2023
Title
Undefined array key "en-GB" and Attempt to read property "sef" \plugins\system\languagefilter\languagefilter.php on line 226
[4.3.4] Undefined array key "en-GB" and Attempt to read property "sef" \plugins\system\languagefilter\languagefilter.php on line 226
avatar peterhulst peterhulst - edited - 18 Sep 2023
avatar richard67
richard67 - comment - 19 Sep 2023

Can it be that the content language for en-GB is missing? I don’t mean the language packs or extensions, I mean the content languages, that’s an extra point in the manage area of the system panel. That’s where the sef property should come from which is mentioned in the error message.

avatar peterhulst
peterhulst - comment - 20 Sep 2023

Hello Richard, you are right: the en-GB was unpublished. After publishing it, the error disappeared.
Is it an idea that a hint is displayed instead many error messages in case this happens?
Thanks for your help.
Regards

avatar richard67
richard67 - comment - 20 Sep 2023

Is it an idea that a hint is displayed instead many error messages in case this happens? Thanks for your help. Regards

@peterhulst Well, I would indeed expect a useful alert instead of an uncaught exception when you enable the language filter and the content language is not published.

I think that's a bug.

On a multilingual site there is also a module shown in the administrator (in the default Atum template it's shown at the top) called "Multilingual Status" or so. That opens a modal which shows what's missing on a multilingual site, and it should show that the content language is not published.

avatar richard67 richard67 - change - 20 Sep 2023
The description was changed
avatar richard67 richard67 - edited - 20 Sep 2023
avatar richard67 richard67 - change - 20 Sep 2023
Labels Added: bug
avatar richard67 richard67 - labeled - 20 Sep 2023
avatar richard67
richard67 - comment - 20 Sep 2023

I've added a sentence about the unpublished content languages to the description (initial post) of this issue so quick readers can better see what the issue is.

avatar peterhulst
peterhulst - comment - 20 Sep 2023

Thank you for the comment.

avatar brianteeman
brianteeman - comment - 30 Sep 2023

When you unpublish all the content languages you already get a nice error message

image

avatar peterhulst
peterhulst - comment - 4 Oct 2023

Thank you Brian!
Indeed this message is very clear.
Regards,
Peter

avatar richard67
richard67 - comment - 4 Oct 2023

Well that's the nice error message when you unpublish the site languages. But when you have them unpublished and enable the language filter, we have the PHP warnings.

So should we leave this issue open and hope someone fixes that, too? Or shall we close it as expected behaviour?

avatar Hackwar Hackwar - close - 8 Apr 2024
avatar Hackwar
Hackwar - comment - 8 Apr 2024

I created a PR. Please test #43232. Since we have a PR, I'm closing this issue.

avatar Hackwar Hackwar - change - 8 Apr 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-04-08 09:06:23
Closed_By Hackwar

Add a Comment

Login with GitHub to post a comment