PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar conseilgouz
conseilgouz
7 Sep 2023

Pull Request for Issue #41635

Summary of Changes

Define missing fields ( $changelog, $changelog, $item) in libraries/src/Changelog/Changelog.php class.

Testing Instructions

PHP 8.2, Joomla 5.0 Beta 1, set "error reporting" to maximum
Load any extension that has an associated changelog file, for example https://extensions.joomla.org/extension/edition/editors/switch-editor-2/
Go to System/Extensions, search for switch editor in extensions list and click on underlined version number to display changelog content.

Actual result BEFORE applying this Pull Request

Error message : SyntaxError: Unexpected token '<', "
"... is not valid JSON
And Error Log shows "PHP Deprecated: Creation of dynamic property" errors

Expected result AFTER applying this Pull Request

changelog is displayed

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

avatar joomla-cms-bot joomla-cms-bot - change - 7 Sep 2023
Category Libraries
avatar conseilgouz conseilgouz - open - 7 Sep 2023
avatar conseilgouz conseilgouz - change - 7 Sep 2023
Status New Pending
avatar conseilgouz conseilgouz - change - 7 Sep 2023
Title
Extensions ChangeLog display not working
[5.0 Beta1] Extensions ChangeLog display not working
avatar conseilgouz conseilgouz - edited - 7 Sep 2023
avatar conseilgouz conseilgouz - change - 7 Sep 2023
Title
[5.0 Beta1] Extensions ChangeLog display not working
[5.0] Extensions ChangeLog display not working
avatar conseilgouz conseilgouz - edited - 7 Sep 2023
avatar Quy Quy - change - 7 Sep 2023
The description was changed
avatar Quy Quy - edited - 7 Sep 2023
avatar HLeithner
HLeithner - comment - 7 Sep 2023

not happy with this @Fedik can you have a look?

avatar conseilgouz
conseilgouz - comment - 7 Sep 2023

May be we could use a try/catch on line 275 as PHP deprecated lines are added in the output buffer, causing JSON error.

Something like :
try{ $this->$key = $val; } catch (\RuntimeException $e){}
But we'll have no more trace of this PHP deprecation.

avatar Fedik
Fedik - comment - 7 Sep 2023

We just need to define a missing properties in the class.
But for this need to find out how Changelog class supposed to work ?

avatar Fedik
Fedik - comment - 7 Sep 2023

You do not need try cacth, iit not critical error. Just a warning.
Set error reaporting to none, and all will work untill php 9

avatar alikon
alikon - comment - 7 Sep 2023

so can we close the issue #41635 as we have a pr ?
@conseilgouz , @Fedik

avatar conseilgouz conseilgouz - change - 7 Sep 2023
The description was changed
avatar conseilgouz conseilgouz - edited - 7 Sep 2023
avatar conseilgouz conseilgouz - change - 7 Sep 2023
Labels Added: PR-5.0-dev
avatar conseilgouz
conseilgouz - comment - 7 Sep 2023

I removed AllowDynamicProperties and defined missing fields.
They are declared as Arrays, but line 249 replaces their contents to a stdClass : see line 247 : $this->currentChangelog->$name = new \stdClass();

avatar conseilgouz conseilgouz - change - 7 Sep 2023
The description was changed
avatar conseilgouz conseilgouz - edited - 7 Sep 2023
avatar Fedik Fedik - change - 8 Sep 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-09-08 09:47:04
Closed_By Fedik
avatar Fedik
Fedik - comment - 8 Sep 2023

There a bug in parser, please test a fix #41675

avatar Fedik Fedik - close - 8 Sep 2023

Add a Comment

Login with GitHub to post a comment