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.

Comments

beeyayjay created an issue. See original summary.

beeyayjay’s picture

Status: Active » Needs review
StatusFileSize
new2.19 KB

Here's the patch

dragonwize’s picture

Status: Needs review » Closed (won't fix)

This is now fixed in the monolog module:
https://www.drupal.org/node/2749859

g-brodiei’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Status: Closed (won't fix) » Active
StatusFileSize
new2.09 KB

Encountering 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.

g-brodiei’s picture

Status: Active » Needs review

Changing status to review as a patch is provided

daniel.bosen’s picture

Status: Needs review » Reviewed & tested by the community

Having the same problem with monolog 2.2.0.
The patch works for me and looks correct.

chr.fritsch’s picture

Status: Reviewed & tested by the community » Fixed

Thank you

  • 92c6aaa committed on 8.x-2.x
    Issue #2909673 by beeyayjay, g-brodiei, daniel.bosen: Doesn't work with...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.