Conflicting Files ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
31 Dec 2021

Replacement for #35888 and #36502

Summary of Changes

  1. The manual check of every "getDBO" string in the file base, replacing those calls where appropriate to use Factory::getContainer()->get('DatabaseDriver'), some could already use the local class property $this->_db so those have been refactored, and some were calling getDBO multiple times where not needed, so those have been cleaned up too

  2. In the files modified when completing 1 above, Some return types in docblocks have been updated to reflect the true state of the current code, as they were highlighted in red in my IDE - ONLY in the files modified in 1 above.

  3. some minor rearranging and refactoring of code around the getDBO calls to make them flow better, and be "nicer"

  4. Manual change of array() to [] syntax for ALL arrays - ONLY in the files modified in 1 above.

This initial PR is 3.0 hours work.

Testing Instructions

Code Review
Test everything multiple times :-)

Actual result BEFORE applying this Pull Request

Technical Debt

Expected result AFTER applying this Pull Request

Less Technical Debt

Documentation Changes Required

None.

avatar PhilETaylor PhilETaylor - open - 31 Dec 2021
avatar PhilETaylor PhilETaylor - change - 31 Dec 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Dec 2021
Category Administration com_admin com_associations com_banners com_categories com_config com_contact com_content com_contenthistory com_fields
dea694b 31 Dec 2021 avatar PhilETaylor cs
avatar PhilETaylor PhilETaylor - change - 31 Dec 2021
Labels Added: ?
8262947 31 Dec 2021 avatar PhilETaylor cs
avatar PhilETaylor
PhilETaylor - comment - 31 Dec 2021

Something broke with installation...

avatar PhilETaylor
PhilETaylor - comment - 31 Dec 2021

ok the fringe case is the installation app.

When in the installation app the databasedriver in the container is not connected to the db, and the first step of the installation uses its own local database connection var.

Its impossible to replace the container resource with a connected db, so, as this is a total exception, I have passed through the $db from the local var, to the LanguageHelper::getInstalledLanguages call and heavily documented why.

Drone should be happier now.

791586e 31 Dec 2021 avatar PhilETaylor cs
avatar PhilETaylor
PhilETaylor - comment - 1 Jan 2022

Phew - build passing again :)

avatar wilsonge
wilsonge - comment - 4 Jan 2022

So this one's a bit tricky for me. Whilst Factory::getContainer()->get('DatabaseDriver') is the direct replacement. the intention is obviously where possible to also use the container as well... as container :) and where possible start to inject the database object into the classes (obviously that only works for the non-static methods/classes - in the rest we probably substitute the container retrieval)

avatar PhilETaylor
PhilETaylor - comment - 4 Jan 2022

This replaces the direct deprecated code with fully supported future code. Another PR can be made in the future to use dependency injection instead. This PR removes the ton of deprecated code which would end up otherwise just getting logged I’m creating huge deprecated log files

avatar PhilETaylor
PhilETaylor - comment - 16 Jan 2022

Conflicts resolved.

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

Too complex to merge it seems, and now have conflicts for the second time.

avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-03-06 21:06:39
Closed_By PhilETaylor
Labels Added: Conflicting Files ?
Removed: ?
avatar PhilETaylor PhilETaylor - close - 6 Mar 2022

Add a Comment

Login with GitHub to post a comment