Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The getDriverClass
central method is still trying to use called with the following
Proposed resolution
Make the fallback work again. Remove the unnecessary classes.
Remaining tasks
None.
User interface changes
None.
API changes
None. These classes were never meant to be used directly.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2461239_6.patch | 7.41 KB | chx |
Comments
Comment #2
chx CreditAttribution: chx at MongoDB commentedWe pass in
Install\Tasks
but alsoSelect
and Select is in Query by core but not in Query per driver so the fallback logic is not flat.Comment #4
chx CreditAttribution: chx at MongoDB commentedOK... So
->extend('Drupal\Core\Database\Query\PagerSelectExtender')
(and similar) was breaking it. After this patch we can change all callers to use->extend('PagerSelectExtender')
if we so want.Also, here is a fun one, I never realized the driver can override the extender by creating a class called
Drupal\drivernamespace\Drupal\Core\Database\Query\PagerSelectExtender
. Probably that wasn't the intention but it is certainly so in HEAD and with this patch too.Comment #6
chx CreditAttribution: chx at MongoDB commentedThat's just a unit test trying to pick up the now nonexistent class. Better luck with pgsql.
Comment #7
jibranhmmm interesting.
Comment #8
Crell CreditAttribution: Crell at Palantir.net commentedThe issue summary is incomplete and breaks off mid-sentence. I think I follow what is being done here from the patch. However, this is a regression. Early in the D8 cycle we switched the child classes to always be required in order to simplify the code. I think I made that change as part of the namespace-ification.
I don't see a reason to go back here. The empty classes hurt no one, and the patch here introduces a while loop into the driver handling that seems completely unnecessary.
I'm inclined to won't-fix.
PS: Yes, driver-specific extender classes are a deliberate design decision. I don't know that they're often used, but I am pretty sure that was deliberate.
Comment #9
chx CreditAttribution: chx at MongoDB commentedBroke out one tiny, tiny bit to #2462653: Connection::getDriverClass doesn't support non-core drivers .