RTC PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar chmst
chmst
15 Oct 2026

Pull Request resolves # .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Use '' if $pk is null

Testing Instructions

Try to add a new language override.

Actual result BEFORE applying this Pull Request

Deprecated: Using null as an array offset is deprecated, use an empty string instead in administrator\components\com_languages\src\Model\OverrideModel.php on line 135 and 143

Expected result AFTER applying this Pull Request

No Deprecated warning

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar chmst chmst - open - 15 Oct 2026
avatar chmst chmst - change - 15 Oct 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Oct 2026
Category ⇒ Administration com_languages
avatar alikon
alikon - comment - 15 Oct 2026

this happens on 5.4 as well

avatar alikon
alikon - comment - 15 Oct 2026

this happens on 5.4 as well

avatar alikon
alikon - comment - 15 Oct 2026

this happens on 5.4 as well

avatar tecpromotion tecpromotion - test_item - 15 Oct 2026 - Tested successfully
avatar tecpromotion
tecpromotion - comment - 15 Oct 2026

I have tested this item ✅ successfully on b98f722

Before: clicking New in Languages → Overrides shows Deprecated: Using null as an array offset at OverrideModel.php:135 and :143.
After: no deprecation. Also tested:

  • new override → Save → rename the key → Save & Close, with "Both" checked: the old key is replaced in both the site and the administrator file
  • edit an existing override: fields and "Both" are prefilled
  • open a key that exists only in the other client's file: base also logged Warning: Undefined array key at line 143 (any PHP 8.x); gone with the PR
  • string search/refresh (AJAX): OK

Suggestions

  1. Same deprecation remains in save(), line 190: isset($strings[$data['id']]). The admin form always posts &id=, so the UI is fine. A new override via the API (POST /api/index.php/v1/languages/overrides/site/en-GB {"key":"X","override":"y"}) has no id and logs:
    Warning: Undefined array key "id" in OverrideModel.php on line 190
    Deprecated: Using null as an array offset is deprecated ... on line 190
    
    Fix: $id = $data['id'] ?? ''; and use $id in lines 190–199.
  2. Nit: $input->get('id', '') ?? '': Input::get() with the default cmd filter never returns null, so ?? '' is redundant. $input->get('id', '') is enough.
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48630.
avatar tecpromotion
tecpromotion - comment - 15 Oct 2026

I have tested this item ✅ successfully on b98f722

Before: clicking New in Languages → Overrides shows Deprecated: Using null as an array offset at OverrideModel.php:135 and :143.
After: no deprecation. Also tested:

  • new override → Save → rename the key → Save & Close, with "Both" checked: the old key is replaced in both the site and the administrator file
  • edit an existing override: fields and "Both" are prefilled
  • open a key that exists only in the other client's file: base also logged Warning: Undefined array key at line 143 (any PHP 8.x); gone with the PR
  • string search/refresh (AJAX): OK

Suggestions

  1. Same deprecation remains in save(), line 190: isset($strings[$data['id']]). The admin form always posts &id=, so the UI is fine. A new override via the API (POST /api/index.php/v1/languages/overrides/site/en-GB {"key":"X","override":"y"}) has no id and logs:
    Warning: Undefined array key "id" in OverrideModel.php on line 190
    Deprecated: Using null as an array offset is deprecated ... on line 190
    
    Fix: $id = $data['id'] ?? ''; and use $id in lines 190–199.
  2. Nit: $input->get('id', '') ?? '': Input::get() with the default cmd filter never returns null, so ?? '' is redundant. $input->get('id', '') is enough.
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48630.
avatar tecpromotion
tecpromotion - comment - 15 Oct 2026

this happens on 5.4 as well

@alikon Right, OverrideModel is the same in 5.4-dev (lines 100/109/117, and 164 in save()), so you get the same messages there on PHP 8.5.

But 5.4 is in security-fix-only mode now. This is a deprecation notice (plus the "Undefined array key" warning) with no functional or security impact, so it doesn't qualify for 5.4. The fix stays in 6.2.

avatar chmst chmst - change - 15 Oct 2026
Labels Added: PR-6.2-dev
avatar chmst
chmst - comment - 15 Oct 2026

In the save() function the issue cannot occur, as there is always at least an empty string has to be saved.
But to be save ...

avatar muhme muhme - test_item - 17 Oct 2026 - Tested successfully
avatar muhme
muhme - comment - 17 Oct 2026

I have tested this item ✅ successfully on dee6ed3

Tested with JBT

  • Seen before PR
    • With backend
      • Trying to create a new overwrite w/o selecting the language ends up in a warning and 4 deprectaion log entries in PHP log
      • Trying to create a new overwrite w/ selecting a language shows the 4 deprecations on backend and PHP log
    • With `api_call "POST" "/v1/languages/overrides/site/en-GB" -d '{"key":"COM_CONTENT_READ_MORE","override":"API READ MORE"}'``
      • There is one deprecation 'Using null as an array offset is deprecated' in OverrideModel.php on line 190
      • And two more warnings:
        • 'Undefined array key "id"' in OverrideModel.php on line 190
        • 'Undefined array key "COM_CONTENT_READ_MORE"' in OverrideModel.php on line 143
  • Applied PR with Patch Tester
    • Tested with backend
      • Trying to create a new new overwrite w/o selecting the language ends up still in a warning, but no deprecations anymore
      • Creating a new overwrite w/ selecting the language is possible, no depreactions are shown on backend or PHP log
    • Tested with API
      • Deprecation warning and the other two warnings are no more shown, language overwrite is updated

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48630.
avatar muhme
muhme - comment - 17 Oct 2026

I have tested this item ✅ successfully on dee6ed3

Tested with JBT

  • Seen before PR
    • With backend
      • Trying to create a new overwrite w/o selecting the language ends up in a warning and 4 deprectaion log entries in PHP log
      • Trying to create a new overwrite w/ selecting a language shows the 4 deprecations on backend and PHP log
    • With `api_call "POST" "/v1/languages/overrides/site/en-GB" -d '{"key":"COM_CONTENT_READ_MORE","override":"API READ MORE"}'``
      • There is one deprecation 'Using null as an array offset is deprecated' in OverrideModel.php on line 190
      • And two more warnings:
        • 'Undefined array key "id"' in OverrideModel.php on line 190
        • 'Undefined array key "COM_CONTENT_READ_MORE"' in OverrideModel.php on line 143
  • Applied PR with Patch Tester
    • Tested with backend
      • Trying to create a new new overwrite w/o selecting the language ends up still in a warning, but no deprecations anymore
      • Creating a new overwrite w/ selecting the language is possible, no depreactions are shown on backend or PHP log
    • Tested with API
      • Deprecation warning and the other two warnings are no more shown, language overwrite is updated

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48630.
avatar muhme
muhme - comment - 17 Oct 2026

⚠️ In testing #47685 I found one more deprecation with api_call GET /v1/languages/overrides/site/en-GB (if overwrites exist or not), which bis not fixed with this PR

PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/administrator/components/com_languages/src/Model/OverridesModel.php on line 100
avatar chmst
chmst - comment - 19 Oct 2026

(#48630 (comment)) this will never occur.
If the client is not "site" or "admin", then the function breaks with error "wrong filename". But if requested I can ad the fix.

avatar chmst
chmst - comment - 19 Oct 2026

(#48630 (comment)) this will never occur.
If the client is not "site" or "admin", then the function breaks with error "wrong filename". But if requested I can add the fix.

avatar muhme
muhme - comment - 20 Oct 2026

(#48630 (comment)) this will never occur. If the client is not "site" or "admin", then the function breaks with error "wrong filename". But if requested I can add the fix.

Thanks for looking into it, @chmst! And are we looking at two different files? 🙂

  • This PR changes OverrideModel.php (single override)
  • The deprecation I found is in OverridesModel.php (list of overrides), line 100:
if (strtoupper($this->getState('list.direction')) == 'DESC') {

It’s about the sort direction, not the client. The list.direction is null for this endpoint, and every API list request triggers:

PHP Deprecated:  strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in .../OverridesModel.php on line 100

I get this with site and with administrator, with or without existing overrides. Suggested fix in OverridesModel.php, lines 94 and 100:

if (strtoupper((string) $this->getState('list.direction', 'asc')) == 'DESC') {

Since this PR has already two successful tests I’m happy to open a new issue, or you can include it here if you prefer. Thanks again!

avatar chmst
chmst - comment - 21 Oct 2026

@muhme sorry I mixed the files. It is great if you can open a new issue. Thank you!

avatar muhme
muhme - comment - 26 Oct 2026

@chmst wrote:

It is great if you can open a new issue. Thank you!

There is #48700 created

avatar robbiejackson robbiejackson - test_item - 30 Oct 2026 - Tested successfully
avatar robbiejackson
robbiejackson - comment - 30 Oct 2026

I have tested this item ✅ successfully on dee6ed3

Tested this with PHP 8.5.12.1 using Eclipse / Xdebug to listen for PHP deprecation notices.

Prior to patch, when I did New language override the 4 deprecation notices appeared and eclipse stopped 4 times at these lines indicating a deprecation.

I used curl to send a POST without an id, and eclipse stopped at the deprecation on line 190.

After applying the patch no deprecation notices appeared for New language override, and eclipse didn't stop when issuing New or the POST sent from curl.


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

avatar robbiejackson
robbiejackson - comment - 30 Oct 2026

I have tested this item ✅ successfully on dee6ed3

Tested this with PHP 8.5.12.1 using Eclipse / Xdebug to listen for PHP deprecation notices.

Prior to patch, when I did New language override the 4 deprecation notices appeared and eclipse stopped 4 times at these lines indicating a deprecation.

I used curl to send a POST without an id, and eclipse stopped at the deprecation on line 190.

After applying the patch no deprecation notices appeared for New language override, and eclipse didn't stop when issuing New or the POST sent from curl.


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

avatar muhme muhme - change - 31 Oct 2026
The description was changed
Status Pending ⇒ Ready to Commit
avatar muhme
muhme - comment - 31 Oct 2026

RTC


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

avatar muhme muhme - edited - 31 Oct 2026
avatar muhme
muhme - comment - 31 Oct 2026

RTC


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

avatar MacJoom MacJoom - change - 6 Nov 2026
Labels Added: RTC
avatar MacJoom MacJoom - change - 6 Nov 2026
Status Ready to Commit ⇒ Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 ⇒ 2026-11-06 16:32:14
Closed_By ⇒ MacJoom
avatar MacJoom MacJoom - close - 6 Nov 2026
avatar MacJoom MacJoom - merge - 6 Nov 2026
avatar MacJoom
MacJoom - comment - 6 Nov 2026

Thank you!

Add a Comment

Login with GitHub to post a comment