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.
When scanning files for classes to be available for autoloading, _registry_parse_file()
will ignore perfectly valid classes defined as final. So for example, the registry will pick up
class NodeController extends DrupalDefaultEntityController {
but if it were ever changed to
final class NodeController extends DrupalDefaultEntityController {
then the registry would ignore it. As of my last grep, core does not include any final classes, but I'm marking this critical because it could cause very odd, confusing blow-ups in contrib if not dealt with. The attached patch fixes the relevant regex.
Comment | File | Size | Author |
---|---|---|---|
final_classes_in_registry.patch | 721 bytes | sdboyer | |
Comments
Comment #1
grendzy CreditAttribution: grendzy commentedmakes sense to me.
Comment #2
chx CreditAttribution: chx commentedBefore someone asks, what else can be there here are lines 329-333 from PHP 5.3 grammar:
So now we are done. (interfaces can't have any of this)
Comment #3
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.