Message

Error: Call to a member function getItemDefinition() on null in Drupal\autotagger_search_in_text\Plugin\Autotagger\SearchInTextFields->tagNode() (line 261 of /web/modules/contrib/autotagger/modules/autotagger_search_in_text/src/Plugin/Autotagger/SearchInTextFields.php).

Backtrace

#0 /web/modules/contrib/autotagger/modules/autotagger_search_in_text/src/Plugin/Autotagger/SearchInTextFields.php(158): Drupal\autotagger_search_in_text\Plugin\Autotagger\SearchInTextFields->tagNode()
#1 /web/modules/contrib/autotagger/autotagger.module(56): Drupal\autotagger_search_in_text\Plugin\Autotagger\SearchInTextFields->entityPresave()
#2 [internal function]: autotagger_node_presave()
#3 /web/core/lib/Drupal/Core/Extension/ModuleHandler.php(389): call_user_func_array()
#4 /web/core/lib/Drupal/Core/Extension/ModuleHandler.php(340): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
#5 /web/core/lib/Drupal/Core/Extension/ModuleHandler.php(388): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#6 /web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(219): Drupal\Core\Extension\ModuleHandler->invokeAll()
#7 /web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(1038): Drupal\Core\Entity\EntityStorageBase->invokeHook()
#8 /web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(568): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#9 /web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(882): Drupal\Core\Entity\EntityStorageBase->doPreSave()
#10 /web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(522): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave()
#11 /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(804): Drupal\Core\Entity\EntityStorageBase->save()
#12 /web/core/lib/Drupal/Core/Entity/EntityBase.php(370): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#13 /web/core/modules/node/src/Form/NodeForm.php(285): Drupal\Core\Entity\EntityBase->save()
#14 /web/core/lib/Drupal/Core/Form/FormSubmitter.php(108): Drupal\node\Form\NodeForm->save()
#15 /web/core/lib/Drupal/Core/Form/FormSubmitter.php(45): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#16 /web/core/lib/Drupal/Core/Form/FormBuilder.php(615): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#17 /web/core/lib/Drupal/Core/Form/FormBuilder.php(347): Drupal\Core\Form\FormBuilder->processForm()
#18 /web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#19 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#20 /web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#21 /web/core/lib/Drupal/Core/Render/Renderer.php(634): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#22 [internal function]: Drupal\Core\Render\Renderer::Drupal\Core\Render\{closure}()
#23 /web/core/lib/Drupal/Core/Render/Renderer.php(649): Fiber->resume()
#24 /web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#25 /web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#26 /vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#27 /vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#28 /web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#29 /web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#30 /web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#31 /web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#32 /web/core/modules/page_cache/src/StackMiddleware/PageCache.php(118): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#33 /web/core/modules/page_cache/src/StackMiddleware/PageCache.php(92): Drupal\page_cache\StackMiddleware\PageCache->pass()
#34 /web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#35 /web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#36 /web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(53): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#37 /web/modules/contrib/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#38 /web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(54): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle()
#39 /web/core/lib/Drupal/Core/DrupalKernel.php(745): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#40 /web/index.php(19): Drupal\Core\DrupalKernel->handle()
#41 {main}

The corresponding content type consists of a title field only. With no source fields or destination set.

Issue fork autotagger-3569059

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 1.0.x Comparecompare
  • 3569059-fix Comparecompare

Comments

neurer created an issue. See original summary.

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

Added null check for destination field definition before calling getItemDefinition(). Also changed `is_null()` to `empty()` for source/destination validation since empty strings should also be handled.

neurer’s picture

Version: 1.0.3 » 1.0.x-dev
Status: Needs review » Reviewed & tested by the community

alvar0hurtad0 made their first commit to this issue’s fork.

alvar0hurtad0’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your work!
The fix is merged and will be part of the next release.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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