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.
I'm trying to replace the Geocoder service by a new one extending it to remove the call to drupal_set_message()
in log()
method.
Problem is that calls to this method are done using self::log($e->getMessage(), 'error');
, so when using the child service, the function called is Geocoder::log()
instead of SilentGeocoder::log()
.
My proposal is to replace those calls with static::log($e->getMessage(), 'error');
to allow inheritence.
PHPdoc reference: http://php.net/manual/en/language.oop5.late-static-bindings.php
Comment | File | Size | Author |
---|---|---|---|
#2 | replace_self_with-2745781-2.patch | 946 bytes | plopesc |
Comments
Comment #2
plopescAttaching patch.
Thanks
Comment #4
Pol