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.
Versions of PHP prior to 5.3.3 will use a constructor with the same name of the class if an __construct function is not found.
The class Drupal\xautoload\Libraries\LibrariesInfoAlter has no constructor but has a function called librariesInfoAlter which ends up getting called on class construction throwing notices on every cache clear.
Comment | File | Size | Author |
---|---|---|---|
#1 | xautoload-2355259-constructor-issue.patch | 535 bytes | codesidekick |
Comments
Comment #1
codesidekick CreditAttribution: codesidekick commentedAttached is a patch that adds an empty constructor to the LibrariesInfoAlter class to avoid errors in PHP version 5.3.0 5.3.1 5.3.2
Comment #2
codesidekick CreditAttribution: codesidekick commentedMore information about this issue can be found at:
http://php.net/manual/en/language.oop5.decon.php
"As of PHP 5.3.3, methods with the same name as the last element of a namespaced class name will no longer be treated as constructor. This change doesn't affect non-namespaced classes."
Comment #4
donquixote CreditAttribution: donquixote commentedFixed in 7.x-5.x.
Please reopen if not.
(and feedback appreciated)