Unit/System Tests PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar heelc29
heelc29
2 Mar 2025

Summary of Changes

DatabaseDriver::getInstance is deprecated and should be replaced with DatabaseFactory->getDriver()
https://github.com/joomla-framework/database/blob/d13a7504471b4730a8107e3566c6fe6d476706fc/src/DatabaseDriver.php#L269-L288

Testing Instructions

install Joomla and visit frontend/backend and see if you can do anything (connection to database is preset)

Actual result BEFORE applying this Pull Request

Warning in deprecated log: DatabaseDriver::getInstance is deprecated and will be removed in 3.0, use DatabaseFactory::getDriver() instead.

 ------ -------------------------------------------------- 
  Line   libraries/src/Service/Provider/Database.php       
 ------ -------------------------------------------------- 
  123    Call to deprecated method getInstance() of class  
         Joomla\Database\DatabaseDriver:                   
         3.0  Use DatabaseFactory::getDriver() instead     
         🪪  staticMethod.deprecated                       
 ------ -------------------------------------------------- 

Expected result AFTER applying this Pull Request

Warning gone

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar heelc29 heelc29 - open - 2 Mar 2025
avatar heelc29 heelc29 - change - 2 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Mar 2025
Category Libraries
avatar heelc29 heelc29 - change - 2 Mar 2025
The description was changed
avatar heelc29 heelc29 - edited - 2 Mar 2025
avatar heelc29
heelc29 - comment - 2 Mar 2025

Failing CI related to #45059

 Error: Unwanted PHP Deprecated: "  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in <b>/tests/www/cmysql/administrator/modules/mod_logged/tmpl/default.php</b> on line <b>36</b>"
avatar heelc29 heelc29 - change - 3 Mar 2025
Labels Added: PR-5.3-dev
avatar exlemor
exlemor - comment - 15 Mar 2025

Hi @heelc29, I might be doing something incorrectly or the testing instructions are incomplete or I couldn't replicate the BEFORE condition as I could not find in the Deprecated.php log any mention of Call to deprecated method getInstance() of class
Joomla\Database\DatabaseDriver:
3.0 Use DatabaseFactory::getDriver() instead
🪪 staticMethod.deprecated

You night want to update your Testing Instructions to advise the turn: Log Deprecated API in Global Configuration if that is where a tester is supposed to find this information...

avatar heelc29
heelc29 - comment - 15 Mar 2025

Hi @heelc29, I might be doing something incorrectly or the testing instructions are incomplete or I couldn't replicate the BEFORE condition as I could not find in the Deprecated.php log any mention of Call to deprecated method getInstance() of class Joomla\Database\DatabaseDriver: 3.0 Use DatabaseFactory::getDriver() instead 🪪 staticMethod.deprecated

Hi @exlemor sorry that I was a bit unclear in the description ... this message comes from phpstan in drone ci, I saw it also with XDebug.

You night want to update your Testing Instructions to advise the turn: Log Deprecated API in Global Configuration if that is where a tester is supposed to find this information...

image

Strangely, it is not logged here - probably because it is in the service provider?

avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2025
Category Libraries Administration com_config Installation Libraries JavaScript Unit Tests
avatar heelc29
heelc29 - comment - 15 Mar 2025

Update more DatabaseDriver::getInstance

Also add system test for config cli command

avatar heelc29 heelc29 - change - 15 Mar 2025
Labels Added: Unit/System Tests
64414fe 16 Mar 2025 avatar heelc29 fix

Add a Comment

Login with GitHub to post a comment