Skip to content

[4.0] Fix PHP 8.1 deprecation - strtolower null param#36397

Closed
PhilETaylor wants to merge 7 commits intojoomla:4.1-devfrom
PhilETaylor:php8-1
Closed

[4.0] Fix PHP 8.1 deprecation - strtolower null param#36397
PhilETaylor wants to merge 7 commits intojoomla:4.1-devfrom
PhilETaylor:php8-1

Conversation

@PhilETaylor
Copy link
Copy Markdown
Contributor

@PhilETaylor PhilETaylor commented Dec 24, 2021

Summary of Changes

Set sane default if the configuration.php has no value for dbtype, for example when running unit tests.

Testing Instructions

on a php 8.1 command line run

libraries/vendor/bin/phpunit tests/Unit/Libraries/Cms/Date/DateTest.php

Actual result BEFORE applying this Pull Request

libraries/vendor/bin/phpunit tests/Unit/Libraries/Cms/Date/DateTest.php

PHPUnit 8.5.21 by Sebastian Bergmann and contributors.

...PHP Deprecated:  strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 60
PHP Deprecated:  strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 65
PHP Deprecated:  strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 78
PHP Deprecated:  strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 111
PHP Deprecated:  strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 116
.
Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 60

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 65

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 78

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 111

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/phil/Sites/joomla-cms/libraries/src/Service/Provider/Database.php on line 116
......                                                        10 / 10 (100%)

Time: 52 ms, Memory: 10.00 MB

OK (10 tests, 32 assertions)

Expected result AFTER applying this Pull Request

libraries/vendor/bin/phpunit tests/Unit/Libraries/Cms/Date/DateTest.php


PHPUnit 8.5.21 by Sebastian Bergmann and contributors.

..........                                                        10 / 10 (100%)

Time: 57 ms, Memory: 10.00 MB

OK (10 tests, 32 assertions)

Documentation Changes Required

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

alikon commented Dec 29, 2021

I have tested this item ✅ successfully on e5aa48f


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

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Jan 16, 2022

Please fix conflicts. Thanks.

@PhilETaylor

This comment was marked as abuse.

@PhilETaylor

This comment was marked as abuse.

@chmst chmst changed the base branch from 4.0-dev to 4.1-dev January 31, 2022 17:34
@Quy
Copy link
Copy Markdown
Contributor

Quy commented Mar 6, 2022

I have tested this item ✅ successfully on 12b40e2


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

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Mar 6, 2022

RTC


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

@joomla-cms-bot joomla-cms-bot added RTC This Pull Request is Ready To Commit and removed RTC This Pull Request is Ready To Commit labels Mar 6, 2022
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.

5 participants