Problem/Motivation

Quite some code in the Database API was deprecated during D9 cycle, for removal in D10.

Proposed resolution

Remove the deprecated functions/features and related legacy tests, adjust where strictly necessary (e.g. per-table prefix could be removed in a separate issue).

Remaining tasks

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

no

Issue fork drupal-3210310

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andypost created an issue. See original summary.

mondrake’s picture

I would suggest to rescope this issue to adjusting ALL the Database API for D10, it will be difficult to separate removing just the magic methods from the rest.

andypost’s picture

Great idea!

mondrake’s picture

StatusFileSize
new60.14 KB

This is more or less doing the job, with current HEAD. Posting so to help future efforts.

mondrake’s picture

Title: Remove __get/__set shims in Database/Statement » Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
mondrake’s picture

andypost’s picture

Summary needs to be extended with other deprecations

mondrake’s picture

StatusFileSize
new68.44 KB
mondrake’s picture

StatusFileSize
new71.93 KB
mondrake’s picture

StatusFileSize
new82.95 KB
mondrake’s picture

StatusFileSize
new89.41 KB
mondrake’s picture

StatusFileSize
new89.53 KB
mondrake’s picture

StatusFileSize
new1.93 KB
new91.32 KB

mondrake’s picture

mondrake’s picture

Version: 10.0.x-dev » 9.3.x-dev

mondrake’s picture

Version: 9.3.x-dev » 10.0.x-dev
mondrake’s picture

Status: Postponed » Active
Issue tags: +PHPStan-0
andypost’s picture

Status: Active » Needs work

murilohp made their first commit to this issue’s fork.

murilohp’s picture

Hey @mondrake, I updated the PR, I think during the rebase, an use statement was removed from the ConnectionTest.php, looking into the failed tests, I haven't seen anything related to the StatementInterface, that's why I decided to rollback this part of the code.

Now the only failed test should be the testComposerLockHash, but I think this is an expected fail because you've changed the composer.lock, I just don't how to make it pass again.

Anyway, if I did something wrong, please let me know.

Thanks!

andypost’s picture

MR needs to change target branch to 10.0.x and only then rebase makes sense

murilohp’s picture

That's a good catch @andypost, unfortunately I don't have access to change the MR target branch, maybe @mondrake could.

mondrake’s picture

Status: Needs work » Postponed
mondrake’s picture

Status: Postponed » Needs review
mradcliffe’s picture

Status: Needs review » Needs work

I think this is Needs work as the MR needs a rebase / merge.

mondrake’s picture

Status: Needs work » Needs review
daffie’s picture

Status: Needs review » Needs work

My first review. I will do another when I have more time.

mondrake’s picture

Status: Needs work » Needs review

Thanks for review @daffie!

WRT type hinting, it's a BC change, it's a broader topic than this issue, new code should be typehinted but I do not see clarity on how to proceed on existing one yet. #3050720: [Meta] Implement strict typing in existing code is still open. So.. not here.

mondrake’s picture

daffie’s picture

Status: Needs review » Needs work

There are unresolved thread on the MR.

mondrake’s picture

Status: Needs work » Needs review
Issue tags: +Needs change record

We need a CR for the deprecation of db_installer_object().

daffie’s picture

Status: Needs review » Needs work

I have create the CR.
There are 4 unresolved threads on the MR.

mondrake’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record

Thanks @daffie

alexpott’s picture

Status: Needs review » Needs work

I can see why you've deprecated db_installer_object() here but I think that this needs it's own issue. I think we should refactor the code here to always call it with $namespace and not be too particular about what goes in $driver. And then we should open and issue to deprecate in Drupal 9.4 for Drupal 11.

mondrake’s picture

Thanks, reverted that deprecation and rerolled.

Filed #3256687: Deprecate db_installer_object() for follow up, although deprecation can only occur in 10 likely, since in 9.4. there may still be around contrib db drivers in the legacy namespace.

mondrake’s picture

Status: Needs work » Needs review
mondrake’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update
daffie’s picture

Status: Needs review » Needs work
mondrake’s picture

Status: Needs work » Needs review
mondrake’s picture

Assigned: Unassigned » mondrake
Status: Needs review » Needs work
mondrake’s picture

Assigned: mondrake » Unassigned
Status: Needs work » Needs review

Reverted all changes to include.inc - those can be addressed separately and the MR now should be deprecation removals only.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

The MR looks good.
The points of @alexpott have been addressed.
For me it is RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 8f2269d and pushed to 10.0.x. Thanks!

 34 files changed, 106 insertions(+), 1689 deletions(-)

That is a lovely diff stat :)

diff --git a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactio
nQueriesTest.php
index 1d735d511de..6f4175e7412 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
@@ -184,7 +184,7 @@ protected function getDatabaseConnectionInfo() {
     // @see \Drupal\database_statement_monitoring_test\mysql\Connection
     // @see \Drupal\database_statement_monitoring_test\pgsql\Connection
     // @see \Drupal\database_statement_monitoring_test\sqlite\Connection
-    $info['default']['namespace'] = '\Drupal\database_statement_monitoring_test\\' . $info['default']['driver'];
+    $info['default']['namespace'] = 'Drupal\database_statement_monitoring_test\\' . $info['default']['driver'];
     return $info;
   }

This change is not necessary. So reverting it on commit. If it is necessary for the db_installer_object changes then we can do this there.

  • alexpott committed 8f2269d on 10.0.x
    Issue #3210310 by mondrake, murilohp, andypost, daffie, alexpott: Adjust...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.