Skip to content

Conversation

@dgrammatiko
Copy link
Contributor

@dgrammatiko dgrammatiko commented Sep 20, 2025

Pull Request for Issue # .

Summary of Changes

Typecast some variables to string to eliminate the deprecation warnings on PHP 8.5

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /xxxx/www/libraries/src/Document/HtmlDocument.php on line 533

Testing Instructions

Open the login page and check the deprecations (PHP8.5 required and error reporting to max)

Actual result BEFORE applying this Pull Request

Deprecations logged in the output

Expected result AFTER applying this Pull Request

No deprecations

B/C: since I'm not changing the signature of the function (arguments should be declared as strings and array there, maybe in J6) this should have zero impact to 3d pt devs.

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 ping

@richard67
Copy link
Member

I don’t really need to be pinged for every 5.4-dev PR.

@richard67
Copy link
Member

@dgrammatiko System test are failing.

@laoneo
Copy link
Member

laoneo commented Sep 21, 2025

Probably we should add PHP 8.5 to the matrix in system tests as well if possible.

@dgrammatiko
Copy link
Contributor Author

@laoneo that would be awesome but atm it’s on beta3 maybe with the rc in a month or so. TBH it would be nice to have Joomla not throwing any errors or warnings before 8.5 is officially released (this the prs)

@laoneo
Copy link
Member

laoneo commented Sep 21, 2025

We will see if we can do something in the ATT team.

@joomdonation
Copy link
Contributor

I have tested this item ✅ successfully on 5d07d05


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

@richard67
Copy link
Member

I am not sure if this change has side effects.

The $name is not only used as array key but also passed as a parameter in the $this->setBuffer call further below here: 1f3d4b0ff411d275d94c1538ef487ef75d4450d772ad2cf712b5796467917f6dR568 .

The code in that method seems to use null values for the particular options if they are not given in the arguments.

With the change here that would be an empty string.

I have no idea what side effects this might have.

@joomdonation
Copy link
Contributor

@richard67 The setBuffer method also changes $name to empty string if null https://github.com/joomla/joomla-cms/blob/5.3-dev/libraries/src/Document/HtmlDocument.php#L603, so the change here does not have any effect for setBuffer call

The $name variable is also used in $renderer->render calls, I also checked and don't see any side affect. I also made real test and did not see any error.

@richard67
Copy link
Member

@joomdonation I see. After having had a deeper look, it seems ok to me.

Copy link
Contributor

@brianteeman brianteeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After applying this patch I now get a fatal error
: Declaration of Joomla\CMS\Event\AbstractImmutableEvent::offsetSet($name, $value) must be compatible with Joomla\Event\Event::offsetSet($name, $value): void in D:\repos\j6\libraries\src\Event\AbstractImmutableEvent.php on line 65

Copy link
Contributor

@brianteeman brianteeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scrub that - I applied the patch to the wrong release

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on 66088c9


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

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 29, 2025
@heelc29
Copy link
Contributor

heelc29 commented Oct 1, 2025

I have tested this item ✅ successfully on 66088c9


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

@HLeithner HLeithner added the bug label Oct 4, 2025
@richard67 richard67 modified the milestones: 5.4.1, Joomla! 5.4.1 Oct 7, 2025
@muhme
Copy link
Contributor

muhme commented Oct 15, 2025

Final test before merge using JBT php8.5-rc

  • Seen dozens Deprecated before PR on loading the frontend, backend or login page
  • Graft PR's full packge
    • ✅ no Deprecated on loading the frontend or backend
    • ⚠️ one Deprecated, in different source file, on loading the frontend "Login Form" module
      • Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/src/Menu/AbstractMenu.php on line 164

Merging this PR and @dgrammatiko could you a look on the remaining Deprecated please?

deprectaed

@muhme muhme merged commit 11dd5c0 into joomla:5.4-dev Oct 15, 2025
40 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 15, 2025
@muhme
Copy link
Contributor

muhme commented Oct 15, 2025

Thank you @dgrammatiko for your contribution. Thank you @joomdonation and @richard67 for supporting. Thank you @brianteeman, @heelc29 and @joomdonation for testing.

@heelc29
Copy link
Contributor

heelc29 commented Oct 15, 2025

Merging this PR and @dgrammatiko could you a look on the remaining Deprecated please?

deprectaed

@muhme There is already a PR to fix it.
#46201

@dgrammatiko dgrammatiko deleted the patch-3 branch October 16, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants