Error when saving scheduled publish field if LoggerChannelFactory has been overriden
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3094183. -->
Reported by: [andy tawse](https://www.drupal.org/user/153292)
>>>
<p>Hi,</p>
<p>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 <code>LoggerChannelFactory</code> parameter, but another module has overriden Drupal's <code>LoggerChannelFactory</code>. The error below happens because the redirect_404 module has decorated `logger.factory`. </p>
<p>It can be fixed by changing the parameter type to <code>LoggerChannelFactoryInterface</code>.</p>
<p>I've attached a patch.</p>
<blockquote><p>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).</p></blockquote>
<p>Thanks.</p>
issue