Skip to content

[6.0] Fix PHP 8.5 null access on array deprecation warning#46733

Merged
Bodge-IT merged 1 commit intojoomla:6.0-devfrom
HLeithner:6.0/fix/null-access-array
Jan 25, 2026
Merged

[6.0] Fix PHP 8.5 null access on array deprecation warning#46733
Bodge-IT merged 1 commit intojoomla:6.0-devfrom
HLeithner:6.0/fix/null-access-array

Conversation

@HLeithner
Copy link
Copy Markdown
Member

The new code for system language filter plugin uses null as default $lang value, this leads to a deprecation warning later in the code for PHP 8.5.

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /plugins/system/languagefilter/src/Extension/LanguageFilter.php on line 376

Summary of Changes

Set the default value to an empty string.

Testing Instructions

Activate full deprecation logging on php 8.5, and try to login with passkeys

Actual result BEFORE applying this Pull Request

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /plugins/system/languagefilter/src/Extension/LanguageFilter.php on line 376

Login Error message that the user has no passkey configuration

Expected result AFTER applying this Pull Request

No Deprecation message and Passkey login Prompt

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@richard67 richard67 added the bug label Jan 20, 2026
@Fedik Fedik added the PHP 8.x PHP 8.x deprecated issues label Jan 21, 2026
@Fedik
Copy link
Copy Markdown
Member

Fedik commented Jan 21, 2026

I have tested this item ✅ successfully on 3bc899f

review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46733.

@heelc29
Copy link
Copy Markdown
Contributor

heelc29 commented Jan 21, 2026

Get a second warning: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in \plugins\system\languagefilter\src\Extension\LanguageFilter.php on line 912

But this is already present in J5.4

@heelc29
Copy link
Copy Markdown
Contributor

heelc29 commented Jan 21, 2026

I have tested this item ✅ successfully on 3bc899f


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46733.

@HLeithner
Copy link
Copy Markdown
Member Author

Get a second warning: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in \plugins\system\languagefilter\src\Extension\LanguageFilter.php on line 912

But this is already present in J5.4

I expect this is the same code in 5.4 and 6.0 so should be fixed in 5.4 and upmerged.

@heelc29
Copy link
Copy Markdown
Contributor

heelc29 commented Jan 21, 2026

I expect this is the same code in 5.4 and 6.0 so should be fixed in 5.4 and upmerged.

Yes, see #46736

@Fedik Fedik removed PHP 8.x PHP 8.x deprecated issues bug PR-6.0-dev labels Jan 21, 2026
@Fedik
Copy link
Copy Markdown
Member

Fedik commented Jan 21, 2026

r2c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46733.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 21, 2026
@Fedik Fedik added PHP 8.x PHP 8.x deprecated issues bug PR-6.0-dev labels Jan 21, 2026
@Bodge-IT Bodge-IT merged commit 7b1b1ab into joomla:6.0-dev Jan 25, 2026
52 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 25, 2026
@Bodge-IT
Copy link
Copy Markdown
Contributor

Thank you for the fix @HLeithner and thanks @heelc29 & @Fedik for prompt tests

@Bodge-IT Bodge-IT added this to the Joomla! 6.0.3 milestone Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug PHP 8.x PHP 8.x deprecated issues PR-6.0-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants