Skip to content

Conversation

@frostmakk
Copy link
Contributor

Pull Request for Issue # .

Summary of Changes

Patching PHP 8.1 deprecation notices where null is provided instead of 'something'.

Testing Instructions

Code review or checking logs.

Actual result BEFORE applying this Pull Request

Deprecation notices

Expected result AFTER applying this Pull Request

No deprecation notices from these files.

Documentation Changes Required

Probably not.

@ghazal
Copy link
Contributor

ghazal commented Dec 20, 2021

I have tested this item ✅ successfully on ef22f70

I chose "Tested successfully" because it does the job, ie showing Deprecated Notices distributed all over admin.

PHP 8.1, and Error Reporting to Maximum, obviously.

Here is what I collected:

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /administrator/components/com_config/src/Controller/DisplayController.php on line 53

Deprecated: Automatic conversion of false to array is deprecated in /libraries/src/Form/Field/RulesField.php on line 181

Deprecated: Function strftime() is deprecated in /libraries/src/Form/Field/CalendarField.php on line 277

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /libraries/src/MVC/View/HtmlView.php on line 254

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /libraries/src/Layout/BaseLayout.php on line 119

Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /administrator/components/com_fields/src/Model/GroupModel.php on line 323

Deprecated: DOMElement::setAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /administrator/components/com_fields/src/Plugin/FieldsPlugin.php
on line 197
on line 199
on line 200


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

@alikon alikon added the PHP 8.x PHP 8.x deprecated issues label Dec 22, 2021
@alikon
Copy link
Contributor

alikon commented Dec 22, 2021

I have tested this item ✅ successfully on b5d53be


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

@alikon
Copy link
Contributor

alikon commented Dec 22, 2021

@ghazal
Copy link
Contributor

ghazal commented Dec 23, 2021

@alikon
I'll test this again as soon as @HLeithner requested changes are solved.
I have begun to test #36362 and #36360 via patchtester, not finished yet.
Right now, I got mainly deprecation notices around strftime(), but I guess this is going to be corrected.

@frostmakk frostmakk requested a review from HLeithner December 23, 2021 16:06
@810
Copy link
Contributor

810 commented Jan 1, 2022

I have tested this item ✅ successfully on 15a6683


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

@PhilETaylor

This comment was marked as abuse.

@richard67
Copy link
Member

@PhilETaylor After @alikon 's there have been made changes which were not just code style, that's why only one test is counted right now if you check in the issue tracker or here at the bottom in the CI checks.

@alikon Could you test again? Thanks in advance. I am at work now so I can't test anything myself.

@PhilETaylor

This comment was marked as abuse.

@ghazal
Copy link
Contributor

ghazal commented Jan 5, 2022

I have tested this item ✅ successfully on 15a6683

From a fresh install of 410 beta3.
BTW, I can apply this PR via patchtester only if I don't apply this one:

[4.0] PHP 8 Ensure that we have a valid date #36396

@PhilETaylor
Thank you for your list of PRs.

[4][com_finder] - php 8.1 serializable-deprecated with unit test #36482
[4.0 - PHP8.1] Remove call to deprecated strftime - with unit test #36469
[4.0] Fix PHP 8.1 deprecation - strtolower null param #36397
[4.0] PHP 8 Ensure that we have a valid date #36396
[4.0] PHP 8.1 deprecation notices libraries/src #36355
PHP 8.1 deprecation fixes #36306


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

@richard67
Copy link
Member

From a fresh install of 410 beta3.

@ghazal Hmm, this PR is for the 4.0-dev branch and so not for 4.1. For lucky circumstance (no other changes on these files meanwhile between 4.0-dev and 4.1-dev) it might be that the PR worked for you. But in general it's not a good idea to test a pull request on a version based on a different branch (4.1-dev) than the target branch of that pull request (4.0-dev).

I am not sure now if I shall count your test and so set the PR to RTC.

Maybe you can test again on a 4.0.x (latest 4.0 nightly or latest 4.0.5 release? That would be great.

Or maybe @alikon can test again?

BTW, I can apply this PR via patchtester only if I don't apply this one:

[4.0] PHP 8 Ensure that we have a valid date #36396

That's expected because the other PR includes a change from this PR here, so both PRs touch the same file at the same place and so conflict with each other (which can be resolved later when one of the 2 PRs has been merged).

@HLeithner
Copy link
Member

Sorry to say but all this ?? '' within a function call is only a band aid it looks like we don't know the input and just ignore the fact that we didn't validated the input correctly.

@PhilETaylor

This comment was marked as abuse.

@HLeithner
Copy link
Member

Yeah that's my fear... but doesn't mean we should continue todo so right?
We want type hinting for all function signatures for Joomla 5. (we will see if we are able to get them) but having a 4 line block at the beginning that can easily be deleted is better then having hard to find ?? '' within the code (without comment)

@PhilETaylor

This comment was marked as abuse.

@HLeithner
Copy link
Member

true, but doesn't mean that we should make it harder to see the problem in future refactoring.

public function hasKey($string)
{
$key = strtoupper($string);
$key = strtoupper($string ?? '');
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably a bad fix - there shouldn't ever be null being passed to this function - if there is - then we should fix it to not be called first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This notice pop up in several places.
Here is a Stack trace from creating a new Random Image module:

PHP Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in ..\libraries\src\Language\Language.php on line 1183
PHP Stack trace:
PHP 1. {main}() ..\administrator\index.php:0
PHP 2. require_once() ..\administrator\index.php:32
PHP 3. Joomla\CMS\Application\CMSApplication->execute() ..\administrator\includes\app.php:63
PHP 4. Joomla\CMS\Application\AdministratorApplication->doExecute() ..\libraries\src\Application\CMSApplication.php:278
PHP 5. Joomla\CMS\Application\AdministratorApplication->dispatch($component = uninitialized) ..\libraries\src\Application\AdministratorApplication.php:186
PHP 6. Joomla\CMS\Component\ComponentHelper::renderComponent($option = 'com_modules', $params = uninitialized) ..\libraries\src\Application\AdministratorApplication.php:143
PHP 7. Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() ..\libraries\src\Component\ComponentHelper.php:389
PHP 8. Joomla\CMS\MVC\Controller\BaseController->execute($task = 'display') ..\libraries\src\Dispatcher\ComponentDispatcher.php:146
PHP 9. Joomla\Component\Modules\Administrator\Controller\DisplayController->display($cachable = uninitialized, $urlparams = uninitialized) ..\libraries\src\MVC\Controller\BaseController.php:730
PHP 10. Joomla\CMS\MVC\Controller\BaseController->display($cachable = uninitialized, $urlparams = uninitialized) ..\administrator\components\com_modules\src\Controller\DisplayController.php:122
PHP 11. Joomla\Component\Modules\Administrator\View\Module\HtmlView->display($tpl = uninitialized) ..\libraries\src\MVC\Controller\BaseController.php:692
PHP 12. Joomla\Component\Modules\Administrator\View\Module\HtmlView->addToolbar() ..\administrator\components\com_modules\src\View\Module\HtmlView.php:78
PHP 13. Joomla\CMS\Language\Language->hasKey($string = NULL) ..\administrator\components\com_modules\src\View\Module\HtmlView.php:156
PHP 14. strtoupper($string = NULL) ..\libraries\src\Language\Language.php:1183

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, probably "early return" when it's empty?

bembelimen added a commit that referenced this pull request Jan 15, 2022
* [4.0] Backup message (#36487)

Many users who use their hosts backup facility and this is typically __only__ for files

This update reminds them to backup the database as well

* Remove reference & in usort callback function (#36503)

* Update paragonie sodium_compat to 1.17.0 (#36491)

Co-authored-by: Benjamin Trenkle <[email protected]>

* [3.10] Finder plugins modify component params registry / Backport #35855 (#36141)

* Backport #35855 to 3.10

* one space to much

* [4.0]  xml code style (#36532)

Fixes a few spaces to tabs issues

* [4.0] media manager breadcrumbs (#36154)

* [4.0] media manager breadcrumbs

The RTL specific css was wrong as can be seen in the before screenshot

This PR removes the RTL specific css (should have been scss) and updates the scss to use logical properties instead.

This PR also removes an unused class `breadcrumb-item`.

To test RTL you will need to install arabic or persian.

and dont forget to npm ci

There is no visible change in LTR and the RTL changes are as shown below

## Before LTR

## Before RTL

## After LTR

## After RTL

* revert

* [4.0] RTL: Correcting Admin login 2factor and feedback hints (#36024)

This is a replacement to the merged PR #32104

It does exactly the same thing but by using css logical properties we avoid the need to maintain both an LTR and an RTL version[4.0]

There is no visual change

* [4.0] Category list (#36536)

Remove extra div that is not needed

* [4.0] Make routing work in console applications (#36332)

* Update list-fancy-select.php (#36543)

replace tab with space

code review

* [4.0] archive icon (#36263)

All the state icons are grey so that the published icon, which is green, stands out visually.

The archived icon however was black. This PR changes that icon to grey.

### Before

### After

* [4.0] Banner Client tips (#36262)

* [4.0] Banner Client tips

Adds a tooltip to the banner client numbers so that they appear the same as category numbers. Also corrects the class on the trashed number so that it has the correct colour

To test
Create one banner client
Create a banner for the client in each of the published states

* Update administrator/components/com_banners/tmpl/clients/default.php

oops

Co-authored-by: Quy <[email protected]>

Co-authored-by: Quy <[email protected]>

* Fix article creation from frontend (#36542)

* [4.0] Handle when toggle icon is not available (#36329)

* Handle when toggle icon is not available

* cs

* Take workflow extension into account when setting a default (#36527)

* Fix uploadlimits checks (#36023)

* Make edit_lock layout reusable for other extensions (#35112)

* Allow to set a value for SubformField (#35921)

* [4.0] Fix example in cleanImageURL docblock (#36554)

* Fix Codemirror behind tabs (#36140)

* Fix Codemirror behind tabs

* jscs

* Remove dependency on Factory in AdminController

* [4.0] Ensure path contains api in the router (#36315)

* [4.0] Check model is set before calling its methods (#36378)

* Check model is set before calling its methods

* Update OverridesController.php

* Category edit form should use return url (#36560)

Currently the article edit form respects return URLs; the category edit form does not. Adding it here makes for a more consistent editing experience.

* [4.0] Sample Data plugin images (#36237)

Updates the plugin to use the new image data used in lazy loading etc. This avoids confusion for users who see different source code for their created articles when compared to the same data plugins

To test. Just make sure the sample data still installs and works as expected

* [4.0] If the Mail Template was not found in the db, return false (#36489)

* [4.0] Code Style (#36564)

* Use an absolute path in image list field (#36063)

* Correct Cache setWorkarounds to take account of multiple script or style declarations being used that mean that we have an array of scripts or stylesheets to be cached and not just a string (#36068)

Cache setWorkarounds returns an array not a string

* [3] privacy request by logged in user only (#35470)

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* Update components/com_privacy/controller.php

Co-authored-by: Quy <[email protected]>

Co-authored-by: Quy <[email protected]>

* Feature - Add always count option to 404 redirects (#34640)

* Feature - Add always count option to 404 redirects

* Add missiing space for code sniffer

* Return line for if statement

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>

* Alpha Ordering - Change Constant too.

* update constant

* Update en-GB.plg_system_redirect.ini

* remove trailing whtiespace

* Remove Added Language Strings

* Update plugins/system/redirect/redirect.php

Co-authored-by: Phil E. Taylor <[email protected]>

* Update redirect.xml

* Update redirect.php

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>

* Update plugins/system/redirect/redirect.php

Co-authored-by: Benjamin Trenkle <[email protected]>

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>
Co-authored-by: Benjamin Trenkle <[email protected]>

* php8 deprecation str_replace Passing null to param (#36400)

* add php 8.1 to the version array (#36577)

* Add function parameters for callbacks. Fixes #36010

* PHP 8.1 deprecation fixes (#36306)

* Backport some deprecation fixes from the J4 branch

* Ensure htmlspecialchars is passed a string

* Ignore PHPCS errors

Co-authored-by: Tobias Zulauf <[email protected]>

* Update simplepie to 1.3.3 (#36358)

* Update simplepie to 1.3.2 & phar-stream-wrapper to 2.2.2

* update to simplepie 1.3.3 to fix the version

* [3.10] Dont show the pre upgrade checker when the upgrade is not supported (#36312)

* [3.10] Fix Progressive caching to cache modules per custom menu assignment (#36324)

* Fix progressive caching

* Update libraries/src/Document/HtmlDocument.php

Co-authored-by: Phil E. Taylor <[email protected]>

* cast int

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>

* Bump registry to 1.6.4 (#36611)

* [4.0] Load the subform data correctly (#36598)

* Load the subform data correctly

* correct order

* don't remove <joomla-hidden-mail> (#36602)

* [4.0] Function to unregister a provider in media manager (#36594)

* [4.0] Latests/Popular Admin modules permissions (#36559)

* Allow our phpcode sniffer composer plugin to run

* PHP 8.1 fixes ported from #36355

* Fix codestyle. Thanks @brianteeman

* Improve security and type checking of the installer task

* Ensure the rule modifier is a string by default

* Ensure cpanel dashboard name is type safe (PHP 8.1)

* Fix mistake in param ordering

* Fix PHP 8.1 notice when creating an article

* Fix URL Field giving deprecated notices in PHP 8.1

* [4.0] Fix template preview (#36268)

* Fix template preview

* Fix template preview

* Fix Progressive caching to cache modules per custom menu assignment (#36193)

* Cross Origin for Google Fonts (#36592)

* Update Tobscure library to be PHP 8.1 compat

* Tag 4.0.6 RC1

* Reset to dev

* Translation Update (#36356)

* [4.0] Fix images (#35780)

* [4.0] Joomla Update Silent fails (#36492)

* [4.0] Joomla Update Silent fails

I am not 100% certain that this is the best approach to this. @nikosdion @wilsonge please advise

## The Problem
As reported in # if during an update a sql query fails then the updater quits the sql part of the update process and moves on. The joomla_update log gives no indication that there has been a problem etc.

## Proposed Partial Solution
Adds a Start SQL and End SQL to the logs
If there is an error in the sql then that is written to the logs as well AND it now says End SQL incomplete

### Testing
For the testing we will be using the "Update your site by manually uploading the update package." and to make things quick I have prepared an empty update that you should download and use.

### Before Test 1
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 2
Update your database to change the value in the #__schemas table so that the version_id is 4.0.0-2018-5-15
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 3
Update your database to change the value in the #__schemas table so that the version_id is 4.0.3
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### After - Test 1
Update your database to change the value in the #__schemas table so that the version_id is 4.0.4

Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### After -  Test 2
Update your database to change the value in the #__schemas table so that the version_id is 4.0.0-2018-5-15
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 3
Update your database to change the value in the #__schemas table so that the version_id is 4.0.3
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

* Fix null being passed to DateTime::__construct causing PHP 8.1 deprecation error

* Missing param default to fix uploads in PHP 8.1

* Tag 4.0.6 RC2

* Reset to dev

* Missing param default to fix renaming media in PHP 8.1

* Stub generator now handles deprecated namespaced classes (#35144)

* Fix error in article model (#36617)

* Fix code comment

* Temporary remove phpnext tests (#36624)

* Sign drone.yml

* Translation Update (#36645)

* Update extract.php (#36635)

* Update composer.lock

Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Harald Leithner <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>
Co-authored-by: Allon Moritz <[email protected]>
Co-authored-by: Quy <[email protected]>
Co-authored-by: Nicola Galgano <[email protected]>
Co-authored-by: Roland Dalmulder <[email protected]>
Co-authored-by: Tuan Pham Ngoc <[email protected]>
Co-authored-by: Fedir Zinchuk <[email protected]>
Co-authored-by: wilsonge <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Crystal Dionysopoulos <[email protected]>
Co-authored-by: heelc29 <[email protected]>
Co-authored-by: Geraint Edwards <[email protected]>
Co-authored-by: Tony Partridge <[email protected]>
Co-authored-by: frostmakk <[email protected]>
Co-authored-by: Dimitris Grammatikogiannis <[email protected]>
Co-authored-by: joomla-translation-bot <[email protected]>
Co-authored-by: Richard Fath <[email protected]>
Co-authored-by: Sveinung Larsen <[email protected]>
bembelimen added a commit that referenced this pull request Jan 15, 2022
* [4.0] Backup message (#36487)

Many users who use their hosts backup facility and this is typically __only__ for files

This update reminds them to backup the database as well

* Remove reference & in usort callback function (#36503)

* Update paragonie sodium_compat to 1.17.0 (#36491)

Co-authored-by: Benjamin Trenkle <[email protected]>

* [3.10] Finder plugins modify component params registry / Backport #35855 (#36141)

* Backport #35855 to 3.10

* one space to much

* [4.0]  xml code style (#36532)

Fixes a few spaces to tabs issues

* [4.0] media manager breadcrumbs (#36154)

* [4.0] media manager breadcrumbs

The RTL specific css was wrong as can be seen in the before screenshot

This PR removes the RTL specific css (should have been scss) and updates the scss to use logical properties instead.

This PR also removes an unused class `breadcrumb-item`.

To test RTL you will need to install arabic or persian.

and dont forget to npm ci

There is no visible change in LTR and the RTL changes are as shown below

## Before LTR

## Before RTL

## After LTR

## After RTL

* revert

* [4.0] RTL: Correcting Admin login 2factor and feedback hints (#36024)

This is a replacement to the merged PR #32104

It does exactly the same thing but by using css logical properties we avoid the need to maintain both an LTR and an RTL version[4.0]

There is no visual change

* [4.0] Category list (#36536)

Remove extra div that is not needed

* [4.0] Make routing work in console applications (#36332)

* Update list-fancy-select.php (#36543)

replace tab with space

code review

* [4.0] archive icon (#36263)

All the state icons are grey so that the published icon, which is green, stands out visually.

The archived icon however was black. This PR changes that icon to grey.

### Before

### After

* [4.0] Banner Client tips (#36262)

* [4.0] Banner Client tips

Adds a tooltip to the banner client numbers so that they appear the same as category numbers. Also corrects the class on the trashed number so that it has the correct colour

To test
Create one banner client
Create a banner for the client in each of the published states

* Update administrator/components/com_banners/tmpl/clients/default.php

oops

Co-authored-by: Quy <[email protected]>

Co-authored-by: Quy <[email protected]>

* Fix article creation from frontend (#36542)

* [4.0] Handle when toggle icon is not available (#36329)

* Handle when toggle icon is not available

* cs

* Take workflow extension into account when setting a default (#36527)

* Fix uploadlimits checks (#36023)

* Make edit_lock layout reusable for other extensions (#35112)

* Allow to set a value for SubformField (#35921)

* [4.0] Fix example in cleanImageURL docblock (#36554)

* Fix Codemirror behind tabs (#36140)

* Fix Codemirror behind tabs

* jscs

* Remove dependency on Factory in AdminController

* [4.0] Ensure path contains api in the router (#36315)

* [4.0] Check model is set before calling its methods (#36378)

* Check model is set before calling its methods

* Update OverridesController.php

* Category edit form should use return url (#36560)

Currently the article edit form respects return URLs; the category edit form does not. Adding it here makes for a more consistent editing experience.

* [4.0] Sample Data plugin images (#36237)

Updates the plugin to use the new image data used in lazy loading etc. This avoids confusion for users who see different source code for their created articles when compared to the same data plugins

To test. Just make sure the sample data still installs and works as expected

* [4.0] If the Mail Template was not found in the db, return false (#36489)

* [4.0] Code Style (#36564)

* Use an absolute path in image list field (#36063)

* Correct Cache setWorkarounds to take account of multiple script or style declarations being used that mean that we have an array of scripts or stylesheets to be cached and not just a string (#36068)

Cache setWorkarounds returns an array not a string

* [3] privacy request by logged in user only (#35470)

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* privacy request logged in only

* Update components/com_privacy/controller.php

Co-authored-by: Quy <[email protected]>

Co-authored-by: Quy <[email protected]>

* Feature - Add always count option to 404 redirects (#34640)

* Feature - Add always count option to 404 redirects

* Add missiing space for code sniffer

* Return line for if statement

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>

* Alpha Ordering - Change Constant too.

* update constant

* Update en-GB.plg_system_redirect.ini

* remove trailing whtiespace

* Remove Added Language Strings

* Update plugins/system/redirect/redirect.php

Co-authored-by: Phil E. Taylor <[email protected]>

* Update redirect.xml

* Update redirect.php

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>

* Update plugins/system/redirect/redirect.php

Co-authored-by: Benjamin Trenkle <[email protected]>

* Update plugins/system/redirect/redirect.php

Co-authored-by: Quy <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>
Co-authored-by: Benjamin Trenkle <[email protected]>

* php8 deprecation str_replace Passing null to param (#36400)

* add php 8.1 to the version array (#36577)

* Add function parameters for callbacks. Fixes #36010

* PHP 8.1 deprecation fixes (#36306)

* Backport some deprecation fixes from the J4 branch

* Ensure htmlspecialchars is passed a string

* Ignore PHPCS errors

Co-authored-by: Tobias Zulauf <[email protected]>

* Update simplepie to 1.3.3 (#36358)

* Update simplepie to 1.3.2 & phar-stream-wrapper to 2.2.2

* update to simplepie 1.3.3 to fix the version

* [3.10] Dont show the pre upgrade checker when the upgrade is not supported (#36312)

* [3.10] Fix Progressive caching to cache modules per custom menu assignment (#36324)

* Fix progressive caching

* Update libraries/src/Document/HtmlDocument.php

Co-authored-by: Phil E. Taylor <[email protected]>

* cast int

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

* Update libraries/src/Document/HtmlDocument.php

Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>

* Bump registry to 1.6.4 (#36611)

* [4.0] Load the subform data correctly (#36598)

* Load the subform data correctly

* correct order

* don't remove <joomla-hidden-mail> (#36602)

* [4.0] Function to unregister a provider in media manager (#36594)

* Joomla! 3.10.5 Release Candidate 1

* [4.0] Latests/Popular Admin modules permissions (#36559)

* Allow our phpcode sniffer composer plugin to run

* PHP 8.1 fixes ported from #36355

* Fix codestyle. Thanks @brianteeman

* Improve security and type checking of the installer task

* Ensure the rule modifier is a string by default

* Ensure cpanel dashboard name is type safe (PHP 8.1)

* Fix mistake in param ordering

* Fix PHP 8.1 notice when creating an article

* Fix URL Field giving deprecated notices in PHP 8.1

* [4.0] Fix template preview (#36268)

* Fix template preview

* Fix template preview

* Fix Progressive caching to cache modules per custom menu assignment (#36193)

* Cross Origin for Google Fonts (#36592)

* Update Tobscure library to be PHP 8.1 compat

* Tag 4.0.6 RC1

* Reset to dev

* reset to dev

* Translation Update (#36356)

* [4.0] Fix images (#35780)

* [4.0] Joomla Update Silent fails (#36492)

* [4.0] Joomla Update Silent fails

I am not 100% certain that this is the best approach to this. @nikosdion @wilsonge please advise

## The Problem
As reported in # if during an update a sql query fails then the updater quits the sql part of the update process and moves on. The joomla_update log gives no indication that there has been a problem etc.

## Proposed Partial Solution
Adds a Start SQL and End SQL to the logs
If there is an error in the sql then that is written to the logs as well AND it now says End SQL incomplete

### Testing
For the testing we will be using the "Update your site by manually uploading the update package." and to make things quick I have prepared an empty update that you should download and use.

### Before Test 1
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 2
Update your database to change the value in the #__schemas table so that the version_id is 4.0.0-2018-5-15
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 3
Update your database to change the value in the #__schemas table so that the version_id is 4.0.3
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### After - Test 1
Update your database to change the value in the #__schemas table so that the version_id is 4.0.4

Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### After -  Test 2
Update your database to change the value in the #__schemas table so that the version_id is 4.0.0-2018-5-15
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

### Before Test 3
Update your database to change the value in the #__schemas table so that the version_id is 4.0.3
Update your install and then check the `administrator\logs\joomla_update.php`
It should look like

* Fix null being passed to DateTime::__construct causing PHP 8.1 deprecation error

* Missing param default to fix uploads in PHP 8.1

* Tag 4.0.6 RC2

* Reset to dev

* Missing param default to fix renaming media in PHP 8.1

* Stub generator now handles deprecated namespaced classes (#35144)

* Fix error in article model (#36617)

* Fix code comment

* Temporary remove phpnext tests (#36624)

* Sign drone.yml

* Use the correct namespace for the taggable trait (#36640)

* Translation Update (#36645)

* Update extract.php (#36635)

* Updated MediaHelper::canUpload function

* Tag RC3

* Reset to dev

Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Harald Leithner <[email protected]>
Co-authored-by: Tobias Zulauf <[email protected]>
Co-authored-by: Allon Moritz <[email protected]>
Co-authored-by: Quy <[email protected]>
Co-authored-by: Nicola Galgano <[email protected]>
Co-authored-by: Roland Dalmulder <[email protected]>
Co-authored-by: Tuan Pham Ngoc <[email protected]>
Co-authored-by: Fedir Zinchuk <[email protected]>
Co-authored-by: wilsonge <[email protected]>
Co-authored-by: Phil E. Taylor <[email protected]>
Co-authored-by: Crystal Dionysopoulos <[email protected]>
Co-authored-by: heelc29 <[email protected]>
Co-authored-by: Geraint Edwards <[email protected]>
Co-authored-by: Tony Partridge <[email protected]>
Co-authored-by: frostmakk <[email protected]>
Co-authored-by: Dimitris Grammatikogiannis <[email protected]>
Co-authored-by: joomla-translation-bot <[email protected]>
Co-authored-by: Richard Fath <[email protected]>
Co-authored-by: Sveinung Larsen <[email protected]>
Co-authored-by: Akshit Rattan <[email protected]>
@Quy Quy changed the base branch from 4.0-dev to 4.1-dev January 27, 2022 17:42
@Quy Quy removed the PR-4.0-dev label Jan 27, 2022
@richard67 richard67 changed the title [4.0] PHP 8.1 deprecation notices libraries/src [4.1] PHP 8.1 deprecation notices libraries/src Jan 31, 2022
public function hasKey($string)
{
$key = strtoupper($string);
$key = strtoupper($string ?? '');
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, probably "early return" when it's empty?


// Prevent to save too large content > 65535
if ((\strlen($this->content) > 65535) || (\strlen($this->params) > 65535))
if ((\strlen($this->content ?? '') > 65535) || (\strlen($this->params) > 65535))
Copy link
Contributor

Choose a reason for hiding this comment

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

As we're checking for "too large" we can add the check in front?

@bembelimen bembelimen added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Mar 12, 2022
@frostmakk
Copy link
Contributor Author

Sorry folks. I don't have time and space in my life for this right now. Please do what you want with this PR, or just close it.

@Quy Quy removed Updates Requested Indicates that this pull request needs an update from the author and should not be tested. RTC This Pull Request is Ready To Commit labels Mar 14, 2022
@frostmakk frostmakk closed this Mar 25, 2022
@frostmakk frostmakk deleted the php81-lib branch March 25, 2022 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PHP 8.x PHP 8.x deprecated issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.