Invalid service backend alias when a driver returns null for driver or databaseType

Created on 12 April 2025, about 2 months ago

Problem/Motivation

Discussing with ghost of drupal past (he prefers not being credited) about backend_overrides( https://www.drupal.org/node/2306083 โ†’ ) he found an edge case where an invalid service alias would be created.

He wrote the fix, I wrote the test.

Steps to reproduce

Create a new db driver which returns NULL for driver() and/or databaseType(), while having a "my-service" tagged as backend_overridable.

An invalid ".my-service" alias would be created. Technically nothing stops us to create a service which id starts with a dot, so this might have any kind of consequences.

Proposed resolution

Check driver() and/or databaseType() before setting the alias.

Remaining tasks

Review.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

๐Ÿ› Bug report
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

bootstrap system

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain penyaskito Seville ๐Ÿ’ƒ, Spain ๐Ÿ‡ช๐Ÿ‡ธ, UTC+2 ๐Ÿ‡ช๐Ÿ‡บ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024