Hi,

When adding the scheduled publish field to a node type I got the following error. This seems to happen if a service is expecting a LoggerChannelFactory parameter, but another module has overriden Drupal's LoggerChannelFactory. The error below happens because the redirect_404 module has decorated `logger.factory`.

It can be fixed by changing the parameter type to LoggerChannelFactoryInterface.

I've attached a patch.

TypeError: Argument 8 passed to Drupal\scheduled_publish\Plugin\Field\FieldFormatter\ScheduledPublishGenericFormatter::__construct() must be an instance of Drupal\Core\Logger\LoggerChannelFactory, instance of Drupal\redirect_404\Render\Redirect404LogSuppressor given, called in /var/www/html/docroot/modules/contrib/scheduled_publish/src/Plugin/Field/FieldFormatter/ScheduledPublishGenericFormatter.php on line 79 in Drupal\scheduled_publish\Plugin\Field\FieldFormatter\ScheduledPublishGenericFormatter->__construct() (line 55 of modules/contrib/scheduled_publish/src/Plugin/Field/FieldFormatter/ScheduledPublishGenericFormatter.php).

Thanks.

CommentFileSizeAuthor
allow_other_logging_factories.patch1.96 KBandy tawse

Comments

Andy Tawse created an issue. See original summary.

saschahannes’s picture

Hi Andy,

thank you for your work!
I'll merge your changes as soon as possible.

Kind regards,
Sascha

saschahannes’s picture

Status: Active » Fixed

I merged your patch and released a new version (3.3)

saschahannes’s picture

Status: Fixed » Closed (fixed)