? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
1 Jul 2020

Closes #29778
Alternative to Closes #29879

Summary of Changes

read history in comments of #29879

Joomla 4 expects developers to use names and not integers for client id

The code was changed in J4 to remove the deprecated behaviour of using numbers see https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4#Updater

The use of numbers was marked as deprecated and documented here in 2012 https://docs.joomla.org/Design_of_JUpdate#Client_versus_Client_ID

If you install an extension that still uses ids then PHP notices can be rendered

This is an alternative to #29879

Testing Instructions

see #29879

Install Akeeba Backup using Install From Url method with url

https://www.akeebabackup.com/download/akeeba-backup/7-2-1/pkg_akeeba-7-2-1-core-zip.zip

After its installed click "Home Dashboard"

Note that in the update checks the Checking extensions has failed

Screenshot 2020-06-25 at 16 30 52

After installing Akeeba, to replicate the issue

Joomla 4 admin
Click System
Click Update -> Extensions
Click Clear Cache
Click Home Dashboard
Inspect the Ajax call
Note JS Console error SyntaxError: JSON Parse error: Unrecognized token '<'

Actual result BEFORE applying this Pull Request

Note JS Console error SyntaxError: JSON Parse error: Unrecognized token '<'

Ajax request with Notices

Screenshot 2020-06-25 at 16 31 42

php_1 | 192.168.32.5 - 25/Jun/2020:15:27:10 +0000 "GET /administrator/index.php" 200
php_1 | 192.168.32.5 - 25/Jun/2020:15:27:10 +0000 "GET /administrator/index.php" 200
php_1 | NOTICE: PHP message: PHP Notice: Trying to get property 'id' of non-object in /application/libraries/src/Updater/Adapter/ExtensionAdapter.php on line 333
php_1 | 192.168.32.5 - 25/Jun/2020:15:27:10 +0000 "GET /index.php" 404
php_1 | 192.168.32.5 - 25/Jun/2020:15:27:10 +0000 "GET /index.php" 404
php_1 | NOTICE: PHP message: PHP Notice: Trying to get property 'id' of non-object in /application/libraries/src/Updater/Adapter/ExtensionAdapter.php on line 333
php_1 | 192.168.32.5 - 25/Jun/2020:15:27:10 +0000 "GET /administrator/index.php" 200
webserver_1 | 2020/06/25 15:27:10 [error] 9#9: *155 FastCGI sent in stderr: "PHP message: PHP Notice: Trying to get property 'id' of non-object in /application/libraries/src/Updater/Adapter/ExtensionAdapter.php on line 333PHP message: PHP Notice: Trying to get property 'id' of non-object in /application/libraries/src/Updater/Adapter/ExtensionAdapter.php on line 333" while reading response header from upstream, client: 192.168.32.1, server: , request: "GET /administrator/index.php?option=com_installer&view=update&task=update.ajax&198756102de4392ec83bef34a7d00709=1&cache_timeout=3600&eid=0&skip=212 HTTP/1.1", upstream: "fastcgi://192.168.32.2:9000", host: "127.0.0.1", referrer: "http://127.0.0.1/administrator/index.php"
php_1 | 192.168.32.5 - 25/Jun/2020:15:27:12 +0000 "GET /administrator/index.php" 200

Expected result AFTER applying this Pull Request

No errors.

Documentation Changes Required

Maybe

avatar PhilETaylor PhilETaylor - open - 1 Jul 2020
avatar PhilETaylor PhilETaylor - change - 1 Jul 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Jul 2020
Category Libraries
f1e7469 1 Jul 2020 avatar PhilETaylor tabs
avatar PhilETaylor PhilETaylor - change - 1 Jul 2020
Labels Added: ?
d865fea 1 Jul 2020 avatar PhilETaylor tabs
avatar brianteeman
brianteeman - comment - 1 Jul 2020

This was deprecated and documented as such 8 years ago - if you insist on ignoring the deprecation then just restore the original code

avatar PhilETaylor PhilETaylor - change - 1 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 1 Jul 2020
avatar PhilETaylor PhilETaylor - change - 1 Jul 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-07-01 18:12:35
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 1 Jul 2020

Add a Comment

Login with GitHub to post a comment