Release Blocker PHP 8.x bug PR-5.1-dev Pending

User tests: Successful: Unsuccessful:

avatar conseilgouz
conseilgouz
7 Apr 2024

Pull Request for Issue #43196.

Summary of Changes

Fix PHP 8.2 deprecated notices during Extensions check while performing Joomla 5.1.0 update

Testing Instructions

Joomla 5.0.3, PHP 8.2 or higher, enable Error reporting to default.
In Joomla Update configuration, set "Potentially incompatible extensions checkbox" to "Show".
Install any non core extension

Update Joomla to 5.1.0-RC shows the Pre-Update Screen.

Actual result BEFORE applying this Pull Request

Extensions check never ends, an error appears in explorer console : uncaught syntaxError..

Expected result AFTER applying this Pull Request

Extensions check works fine

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 conseilgouz conseilgouz - open - 7 Apr 2024
avatar conseilgouz conseilgouz - change - 7 Apr 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Apr 2024
Category Administration com_joomlaupdate Libraries
avatar conseilgouz conseilgouz - change - 7 Apr 2024
Title
Extensions check stuck #43196
[5.0] Extensions check stuck #43196
avatar conseilgouz conseilgouz - edited - 7 Apr 2024
avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

Administrator/components/com_joomlaupdate/src/Model/UpdateModel.php creates a new Update object in function checkCompatibility, line 1629 and below. It tries to set properties that do not exist in Update object.
This fix creates the missing properties.
Note : $jversion.full has been renamed $jversionfull.

avatar conseilgouz conseilgouz - change - 7 Apr 2024
The description was changed
avatar conseilgouz conseilgouz - edited - 7 Apr 2024
avatar conseilgouz conseilgouz - change - 7 Apr 2024
The description was changed
avatar conseilgouz conseilgouz - edited - 7 Apr 2024
avatar brianteeman
brianteeman - comment - 7 Apr 2024

I still cannot replicate the reported error. Maybe I am missing a step. Can you please make a screen recording showing everything you did to create the error. I use licecap for this.

avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

Clean Joomla 5.0.3 install + any non core extension (I installed latest Akeeba Backup), PHP 8.2 or higher

pull43226.mp4
avatar richard67
richard67 - comment - 7 Apr 2024

Does the issue also happen with error reporting = none?
If no, then we have a readable workaround and we just should recommend that in the release announcement.

And does it also happen on 4.4? If yes, the PR should be made for the 4.4-dev branch, and that will later be merged up into 5.1-dev by maintainers. If no, the PR should be made for the 5.1-dev branch as there will not be any new 5.0.x release.

avatar brianteeman
brianteeman - comment - 7 Apr 2024

finaly I can replicate it. I was performing the update using the upload and update function and that produces no errors

avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

I just tried a Joomla 4.4.3 environment and this issue does not occur.
Joomla 5 update class uses LegacyPropertyManagementTrait which causes notices display.

avatar brianteeman
brianteeman - comment - 7 Apr 2024

LegacyPropertyManagementTrait was introduced by @laoneo #40999 for 5.0.0

avatar conseilgouz conseilgouz - change - 7 Apr 2024
Labels Added: PR-5.0-dev
avatar joomla-cms-bot joomla-cms-bot - change - 7 Apr 2024
Category Administration com_joomlaupdate Libraries Unit Tests Repository Administration com_admin SQL Postgresql com_associations
avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

Oups, I blow it up while trying to rebase it to Joomla 5.1

avatar richard67
richard67 - comment - 7 Apr 2024

@conseilgouz Have you just tried to rebase your branch? If so, it seems there went something Wrong. You should change the base branch on GitHub by using the "Edit" button right beside the PR title. Let me know if I shall do that for you.

avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

@richard67 : well, after trying rebase from my PC, 1120 updated files ???? your help is more than welcomed.

avatar richard67
richard67 - comment - 7 Apr 2024

@richard67 : well, after trying rebase from my PC, 1120 updated files ???? your help is more than welcomed.

@conseilgouz As said, it needs to change the base branch on GitHub. I will do that now.

avatar richard67 richard67 - change - 7 Apr 2024
Labels Added: Unit/System Tests
avatar joomla-cms-bot joomla-cms-bot - change - 7 Apr 2024
Category Administration Unit Tests Repository com_admin SQL Postgresql com_associations Administration com_joomlaupdate Libraries Front End Plugins
avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

what about the 1120 updated files ?

avatar richard67
richard67 - comment - 7 Apr 2024

what about the 1120 updated files ?

@conseilgouz Check again. Now there are only 4 remaining. But there are still some unrelated changes in files plugins/content/vote/src/Extension/Vote.php and plugins/content/vote/src/Extension/Vote.php shown. Could you check and revert?

avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

it still contains my other PR#42933

avatar richard67
richard67 - comment - 7 Apr 2024

it still contains my other PR#42933

@conseilgouz Yes, because you have rebased to YOUR 5.1-dev branch, and you have made the other PR not on a separate branch but on the 5.1-dev branch. You should have rebased this PR to the UPSTREAM 5.1-dev.

avatar richard67
richard67 - comment - 7 Apr 2024

@conseilgouz P.S.: Just revert these changes here and this PR here is ok.

avatar conseilgouz conseilgouz - change - 7 Apr 2024
Title
[5.0] Extensions check stuck #43196
[5.1] Extensions check stuck #43196
avatar conseilgouz conseilgouz - edited - 7 Apr 2024
avatar conseilgouz conseilgouz - change - 7 Apr 2024
Labels Added: PHP 8.x bug PR-5.1-dev
Removed: Unit/System Tests PR-5.0-dev
avatar joomla-cms-bot joomla-cms-bot - change - 7 Apr 2024
Category Administration com_joomlaupdate Libraries Front End Plugins Administration com_joomlaupdate Libraries
avatar brianteeman
brianteeman - comment - 7 Apr 2024

are you sure that it is ok to rename jversion.full to jversionfull ?

avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

are you sure that it is ok to rename jversion.full to jversionfull ?

I checked in all the sources and it's only used in Update class and in JoomlaUpdate Model.

avatar brianteeman
brianteeman - comment - 7 Apr 2024

but why rename it?

avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

I did not find a way to define a variable with this kind of name (with a dot).

avatar brianteeman
brianteeman - comment - 7 Apr 2024

just seems wrong that to fix the bug you need to change the name of something that has been in use for a very long time.

@laoneo as you made the change to LegacyPropertyManagementTrait in #40999 for 5.0.0 does this look correct to you.

It smells of being a bandaid to fix a bigger issue

avatar conseilgouz
conseilgouz - comment - 7 Apr 2024

jversion.full is just a variable.

It's only used in Update class with a preg_match (line 364) : preg_match('/^' . $this->currentUpdate->targetplatform->version . '/', $this->get('jversion.full', JVERSION))

In PHP 8.2, we have to define it before using it in an object, otherwise it sends a deprecated notice but it creates it anyway.
In PHP 9, this will cause an error.

I had to change variable name as I did not find a way of declaring a variable with a dot in its name.

FYI, in Joomla 3.10, jversion.full was already there and there was also jversion.dev_level (never initialized, so containing Version::PATCH_VERSION). Both variables were used in Update class the same way they were in later Joomla versions.

avatar conseilgouz conseilgouz - change - 7 Apr 2024
Title
[5.1] Extensions check stuck #43196
[5.1]Joomla Update : extensions check never ends
avatar conseilgouz conseilgouz - edited - 7 Apr 2024
avatar bembelimen
bembelimen - comment - 7 Apr 2024

Thanks @conseilgouz for the finding. We have to discuss how we handle this issue best. It need to be fixed asap, but either it will trigger a new 5.0.x or we will move it to 5.1.1. Sadly 5.1.0 is the wrong version for it, but we get it managed :)

Thanks for the finding and the PR.

Edit: just saw that @brianteeman mentioned it before, yes it's #40999 (tbh it's when the trait was implemented in 4.3 and was not replacing the full functionality). The dependency of stdClass was removed by this PR, so we have to think how to solve it.

avatar laoneo
laoneo - comment - 8 Apr 2024

@conseilgouz can you rename the variable jversionfull to $targetVersion? Like that it is more meaningful. Also remove the set and get calls and make a proper setter function like `setTargetVersion for it with the? Thanks...

avatar conseilgouz
conseilgouz - comment - 8 Apr 2024

@laoneo : ok for targetVersion. In progress...
What about other variables that have been added "the hard way" : downloadurl, tag, stability... ?
It's not the purpose of this PR, but could be cleaner

avatar conseilgouz conseilgouz - change - 8 Apr 2024
Labels Added: Release Blocker
avatar laoneo
laoneo - comment - 8 Apr 2024

@laoneo : ok for targetVersion. In progress... What about other variables that have been added "the hard way" : downloadurl, tag, stability... ? It's not the purpose of this PR, but could be cleaner

You mean to make getter and setter functions for them?

avatar conseilgouz
conseilgouz - comment - 8 Apr 2024

@laoneo : ok for targetVersion. In progress... What about other variables that have been added "the hard way" : downloadurl, tag, stability... ? It's not the purpose of this PR, but could be cleaner

You mean to make getter and setter functions for them?

Well, I was thinking about this, but it's tricky to find the "getters" and the variables are set in _endElement thru a nice foreach (get_object_vars($this->latest) as $key => $val) {
$this->$key = $val;
}
So the setters are also not that easy to create.

avatar conseilgouz
conseilgouz - comment - 9 Apr 2024

Everything seems to be ok (thank you @richard67, @laoneo for the time you spent ), but, it applies to Joomla 5.1 when initial issue was about "J5.0.3 update to J5.1.0 does not work".
Did it worth the time we spent ?

avatar richard67
richard67 - comment - 9 Apr 2024

@conseilgouz Well we can’t fix it for 5.0.3 with a CMS update, and we have a workaround for this, switching off error reporting, but we need the fix also for later updates from 5.1.0 to e.g. 5.1.1 in future, so it is ok for 5.1.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
[5.1]Joomla Update : extensions check never ends
[5.1] Joomla Update : extensions check never ends
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar conseilgouz conseilgouz - change - 30 Apr 2024
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2024-04-30 18:08:11
Closed_By conseilgouz
avatar conseilgouz conseilgouz - close - 30 Apr 2024
avatar richard67
richard67 - comment - 1 May 2024

@conseilgouz You‘ve deleted your fork of the joomla repository, so this PR was closed. Was this a mistake or by purpose?

avatar conseilgouz
conseilgouz - comment - 1 May 2024

Hi Richard,
I had 2 other PR's which said I could delete my fork and I forgot about this one.
I thought it was already closed.
need a "refork" ?

avatar richard67
richard67 - comment - 1 May 2024

need a "refork" ?

@conseilgouz I think so. The PR was not closed by us, and it was approved by @laoneo , so it would have just needed 2 human tests. If you still want to provide a PR, I think you have to fork again and redo the PR.

avatar richard67
richard67 - comment - 1 May 2024

New PR is #43410 . @laoneo Could you approve that one, too? It’s the same as this one here which had been closed by mistake.

Add a Comment

Login with GitHub to post a comment