Problem/Motivation
Follow up of #3056698: Sqlite Connection::createConnectionOptionsFromUrl should not convert relative paths to full.
Deprecate passing $root to \Drupal\Core\Database\Connection::createConnectionOptionsFromUrl - it is not used any implementations.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3506931
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:
- 3506931-deprecate-passing-root
changes, plain diff MR !11393
Comments
Comment #2
mondrakeComment #4
mondrakeComment #5
daffie commentedThe CI pipeline is failing with a PHPStan error.
Do we need a deprecation message test?
Comment #6
mondrakeComment #7
charlliequadros commentedWe must follow this documentation to deprecate anything in Drupal.
https://www.drupal.org/about/core/policies/core-change-policies/how-to-deprecate
Comment #9
adwivedi008 commentedHello @charlliequadros
I tried to update the deprication message by following the instructions
Please review and suggest if any other changes are required
Also, the change record needs to be created.
Comment #10
charlliequadros commentedHi @adwivedi008 ,
I left a comment, but I'm just starting to contribute to the community.
Maybe we can check with someone more experienced to see if what I said makes sense.
Comment #11
mondrakeHi! Please note that here we are deprecating usage of a method parameter, not of a whole method.
The instructions to be followed for this case are here https://www.drupal.org/about/core/policies/core-change-policies/how-to-d...
Comment #13
brandonlira commentedHi @mondrake,
I have updated the code according to the deprecation guidelines for method parameters in Drupal:
The $root parameter is marked as deprecated, but the method itself remains functional.
A @trigger_error() has been added following the documentation.
The @see annotation references the correct change record.
However, I noticed that some tests fail due to deprecation warnings related to passing $root. These warnings appear in multiple functional JavaScript tests, such as:
Would you recommend updating these tests to avoid passing $root, or should we add an explicit handling for this in the code? Let me know the best approach so I can make the necessary adjustments.
Thank you!
Comment #14
brandonlira commentedComment #15
smustgrave commentedLeft comments on MR.
Comment #16
mondrakeSorry I was probably underestimating this when tagging for Novice. Removed tag. Working on this.
Comment #17
mondrakeComment #18
daffie commentedAll code changes look good.
The deprecation message testing has been added.
For me it is RTBC.
Comment #20
longwaveThis is kinda ugly, but I don't see a better way. We can deprecate the same argument from
Database::convertDbUrlToConnectionInfo()in a followup, because similarly it is no longer used now.Committed 4e42a4f and pushed to 11.x. Thanks!
Also published the change record and updated it a little with instructions on what to actually do.
Comment #22
longwaveFollowup: #3522513: Deprecate passing $root to \Drupal\Core\Database\Database::convertDbUrlToConnectionInfo()
Comment #23
longwave