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

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

mondrake created an issue. See original summary.

mondrake’s picture

Title: Deprecate passing $root to \Drupal\Core\Database\Connection::createConnectionOptionsFromUr » Deprecate passing $root to \Drupal\Core\Database\Connection::createConnectionOptionsFromUrl

mondrake’s picture

Status: Active » Needs review
daffie’s picture

Status: Needs review » Needs work

The CI pipeline is failing with a PHPStan error.
Do we need a deprecation message test?

mondrake’s picture

Issue tags: +Novice
charlliequadros’s picture

We must follow this documentation to deprecate anything in Drupal.

https://www.drupal.org/about/core/policies/core-change-policies/how-to-deprecate

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

adwivedi008’s picture

Status: Needs work » Needs review

Hello @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.

charlliequadros’s picture

Hi @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.

mondrake’s picture

Status: Needs review » Needs work

Hi! 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...

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

brandonlira’s picture

Hi @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:

ToolbarActiveTrailTest
RegistrationWithUserFieldsTest
ClickSortingAJAXTest
FilterTest
FieldDialogsTest
ViewsWizardTest

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!

brandonlira’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Left comments on MR.

mondrake’s picture

Assigned: Unassigned » mondrake
Issue tags: -Novice

Sorry I was probably underestimating this when tagging for Novice. Removed tag. Working on this.

mondrake’s picture

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

Status: Needs review » Reviewed & tested by the community

All code changes look good.
The deprecation message testing has been added.
For me it is RTBC.

  • longwave committed 4e42a4f9 on 11.x
    Issue #3506931 by mondrake, brandonlira, adwivedi008, daffie,...
longwave’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

This 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.

longwave’s picture

Status: Fixed » Closed (fixed)

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