Problem/Motivation
Issue #3555387 fixed the Messenger concrete class type hint in Api.php,
but the same bug exists in two other classes in the same module:
- src/VclHandler.php (line 9, 162, 203, 210)
- src/Controller/FastlyEdgeModulesController.php (line 9, 52, 66, 69)
Both still use Drupal\Core\Messenger\Messenger (the concrete class)
instead of Drupal\Core\Messenger\MessengerInterface.
This causes a fatal TypeError on any page served by these classes when
another module overrides the messenger service with a different
implementation (e.g. Drupal Canvas, which registers Drupal\canvas\Messenger).
Steps to reproduce
1. Install drupal/fastly ^4.0.5
2. Install drupal/canvas (or any module that overrides the messenger service)
3. Visit /admin/config/services/fastly → TypeError in VclHandler
4. Visit /admin/config/services/fastly/edge-modules → TypeError in FastlyEdgeModulesController
Proposed resolution
Replace the concrete Drupal\Core\Messenger\Messenger type hint with
Drupal\Core\Messenger\MessengerInterface in both files (same fix already
applied to Api.php in #3555387).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fastly_vcl_handler_messenger_interface_3593921_2.patch | 3.09 KB | nikolaat |
Comments
Comment #2
nikolaat