($logger) must be of type Drupal\Core\Logger\LoggerChannelFactory, Drupal\redirect_404\Render\Redirect404LogSuppressor given

Created on 24 October 2023, about 1 year ago
Updated 2 February 2024, 10 months ago

Problem/Motivation

Hi,

I'm having a first try at the module and when saving an entity (taxonomy term) I get the following error and the interpolation process fails:

TypeError: Drupal\ai_interpolator\Plugin\AiInterpolatorProcess\DirectSaveProcessing::__construct(): Argument #2 ($logger) must be of type Drupal\Core\Logger\LoggerChannelFactory, Drupal\redirect_404\Render\Redirect404LogSuppressor given, called in /var/www/***/modules/contrib/ai_interpolator/src/Plugin/AiInterpolatorProcess/DirectSaveProcessing.php on line 62 in Drupal\ai_interpolator\Plugin\AiInterpolatorProcess\DirectSaveProcessing->__construct() (line 47 of /var/www/***/modules/contrib/ai_interpolator/src/Plugin/AiInterpolatorProcess/DirectSaveProcessing.php).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇹🇭Thailand AlfTheCat

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @AlfTheCat
    • e823d5e1 committed on main
      Issue #3396298: ($logger) must be of type Drupal\Core\Logger\...
  • 🇩🇪Germany marcus_johansson

    Thanks for spotting the bug. It should use a LoggerChannelFactoryInterface instead so any module like redirect_404 can override the logging.

  • Assigned to marcus_johansson
  • 🇹🇷Turkey orkut murat yılmaz Istanbul

    Hello all,

    I'm getting the similar error, when I try to use AI Interpolator Pixabay. The log is below:

    TypeError: Drupal\ai_interpolator\Plugin\AiInterpolatorProcess\DirectSaveProcessing::__construct(): Argument #2 ($logger) must be of type Drupal\Core\Logger\LoggerChannelFactory, Drupal\redirect_404\Render\Redirect404LogSuppressor given, called in /var/www/html/web/modules/contrib/ai_interpolator/src/Plugin/AiInterpolatorProcess/DirectSaveProcessing.php on line 57 in Drupal\ai_interpolator\Plugin\AiInterpolatorProcess\DirectSaveProcessing->__construct() (line 47 of /var/www/html/web/modules/contrib/ai_interpolator/src/Plugin/AiInterpolatorProcess/DirectSaveProcessing.php)
    
    #0 /var/www/html/web/modules/contrib/ai_interpolator/src/Plugin/AiInterpolatorProcess/DirectSaveProcessing.php(57): Drupal\ai_interpolator\Plugin\AiInterpolatorProcess\DirectSaveProcessing->__construct()
    #1 /var/www/html/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\ai_interpolator\Plugin\AiInterpolatorProcess\DirectSaveProcessing::create()
    #2 /var/www/html/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance()
    #3 /var/www/html/web/modules/contrib/ai_interpolator/src/AiInterpolatorEntityModifier.php(151): Drupal\Component\Plugin\PluginManagerBase->createInstance()
    #4 /var/www/html/web/modules/contrib/ai_interpolator/src/AiInterpolatorEntityModifier.php(86): Drupal\ai_interpolator\AiInterpolatorEntityModifier->getProcesses()
    #5 /var/www/html/web/modules/contrib/ai_interpolator/ai_interpolator.module(26): Drupal\ai_interpolator\AiInterpolatorEntityModifier->saveEntity()
    #6 [internal function]: ai_interpolator_entity_presave()
    #7 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(409): call_user_func_array()
    #8 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(388): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
    #9 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(408): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
    #10 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(217): Drupal\Core\Extension\ModuleHandler->invokeAll()
    #11 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(900): Drupal\Core\Entity\EntityStorageBase->invokeHook()
    #12 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(529): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
    #13 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(753): Drupal\Core\Entity\EntityStorageBase->doPreSave()
    #14 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave()
    #15 /var/www/html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(806): Drupal\Core\Entity\EntityStorageBase->save()
    #16 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
    #17 /var/www/html/web/core/modules/node/src/NodeForm.php(270): Drupal\Core\Entity\EntityBase->save()
    #18 [internal function]: Drupal\node\NodeForm->save()
    #19 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array()
    #20 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
    #21 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm()
    #22 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm()
    #23 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
    #24 /var/www/html/web/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult()
    #25 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
    #26 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
    #27 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(592): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #28 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
    #29 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
    #30 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #31 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #32 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
    #33 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #34 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #35 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
    #36 /var/www/html/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
    #37 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
    #38 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #39 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #40 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
    #41 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
    #42 {main}

    Thanks for this great module again.

    Best,
    Orkut

  • Status changed to Needs review about 1 year ago
  • 🇹🇭Thailand AlfTheCat

    Great work on the fix, and thanks for the quick response. I'll patch the module files manually tonight, which raises the question if we could perhaps have a dev release so it's easier for everyone to update their code. I'll make an issue for it.

  • 🇹🇷Turkey orkut murat yılmaz Istanbul

    I got rid of the error message, by applying patch. Thank you:)

  • 🇹🇭Thailand AlfTheCat

    It's working now using the direct sasve method but similar changes are required to:

    /ai_interpolator/src/Plugin/QueueWorker/InterpolatorFieldData.php

    and

    /ai_interpolator/src/Plugin/AiInterpolatorProcess/BatchProcessing.php

    in order to get batch and queue based interpolation to work. I made manual edits to the code and it seems to work.

  • Status changed to Needs work about 1 year ago
    • AlfTheCat authored d0bc0534 on dev
      Issue #3396298 by AlfTheCat: ($logger) must be of type Drupal\Core\...
  • 🇩🇪Germany marcus_johansson

    @AlfTheCat - Thank you, this is also updated on the DEV branch.

  • Status changed to Needs review about 1 year ago
    • AlfTheCat authored d0bc0534 on main
      Issue #3396298 by AlfTheCat: ($logger) must be of type Drupal\Core\...
  • Status changed to Fixed 10 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024