Active
Project:
Drupal core
Version:
main
Component:
composer
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2022 at 17:50 UTC
Updated:
1 Nov 2022 at 20:05 UTC
Jump to comment: Most recent
This might not be a bug with Drupal, but rather one with Composer. Or perhaps not a bug at all.
While debugging something else, I noticed that in vendor/composer/ClassLoader.php::loadClass(), when loading this class:
Drupal\mysql\Driver\Database\mysql\Connection
The returned path file path is this:
/var/www/html/web/core/modules/mysql/src/Driver/Database/mysql//Connection.php
Notice that there are two slashes in a row. "mysql//Connection.php"
These can be found by creating a conditional breakpoint in ClassLoader inside
function includeFile($file)
{
include $file;
}
The breakpoint condition can be str_contains($file, '//')
I am using Drupal 9.4.8 with PHP 8.1.11 and composer 2.4.3.
Comments
Comment #2
cilefen commentedIsn't that one of the problematic classes that had to be worked around in some use-cases? In this case I mean #3290924: [regression] With Drupal 9.4, can no longer call Database::getConnection() from within settings.php due to driver classes not yet in autoloader. And the workaround was to define these namespaces in settings.php. Is that possibly the case with the affected site?
Comment #3
solideogloria commentedI am not calling Database::getConnection from settings.php. In fact, I have no errors at all. I just happened to see this odd result while debugging something else.
Comment #4
cilefen commentedIs only this class affected?
Comment #5
solideogloria commentedNo, it appears any class within that parent folder shows that way, such as
I don't know if it happens for other DB drivers.
Comment #6
solideogloria commentedThese can be found by creating a conditional breakpoint in ClassLoader inside
The breakpoint condition can be
str_contains($file, '//')Comment #7
solideogloria commented