If Media entity Twitter and Monolog are both enabled, the following error occurs:
Recoverable fatal error: Argument 9 passed to Drupal\media_entity_twitter\Plugin\MediaEntity\Type\Twitter::__construct() must be an instance of Drupal\Core\Logger\LoggerChannelInterface, instance of Drupal\monolog\Logger\Logger given, called in /var/www/law.columbia.edu/docroot/modules/contrib/media_entity_twitter/src/Plugin/MediaEntity/Type/Twitter.php on line 70 and defined in Drupal\media_entity_twitter\Plugin\MediaEntity\Type\Twitter->__construct() (line 104 of modules/contrib/media_entity_twitter/src/Plugin/MediaEntity/Type/Twitter.php).
The problem can be resolved by using the Psr\Log\LoggerInterface in place of Drupal\Core\Logger\LoggerChannelInterface.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2909673-4.patch | 2.09 KB | g-brodiei |
| #2 | monolog_compatibility-2909673-2.patch | 2.19 KB | beeyayjay |
Comments
Comment #2
beeyayjay commentedHere's the patch
Comment #3
dragonwize commentedThis is now fixed in the monolog module:
https://www.drupal.org/node/2749859
Comment #4
g-brodieiEncountering this issue for version 2.x while enabling drupal/monolog 2.0.0-beta2.
The original fix of #2749859: Logger channel factory must return instances of LoggerChannelInterface on LoggerChannelInterface is going to be deprecated. see #2760433: Deprecate/remove LoggerChannelInterface.
media_entity_twiiter module should follow the steps of #3248651: module should use Psr\Log\LoggerInterface to allow other logging modules e.g. monolog to make use of Psr\Log\LoggerInterface to allow the use of other logger services (monolog).
Providing patch to fix 2.x version.
Comment #5
g-brodieiChanging status to review as a patch is provided
Comment #6
daniel.bosenHaving the same problem with monolog 2.2.0.
The patch works for me and looks correct.
Comment #7
chr.fritschThank you