Created on 18 February 2023, almost 2 years ago

Problem/Motivation

1.I have created paragraphs type with simple text field (plain) field called "field_a"
2.I have created content type with just paragraph referenced to #1 field called "field_parag_test"
3.I have created a test node with title and with paragraph text plain.
4.Now I want to clone it for a new node :
/node/add/itempate_clone_parag?fieldclone=node:157635:field_parag_test

I am getting following error:

 	TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, Drupal\Core\Entity\ContentEntityType given in htmlspecialchars() (line 424 of /core/lib/Drupal/Component/Utility/Html.php)
	
#0 /core/lib/Drupal/Component/Utility/Html.php(424): htmlspecialchars()	
#1 /core/lib/Drupal/Component/Render/FormattableMarkup.php(262): Drupal\Component\Utility\Html::escape()	
#2 /core/lib/Drupal/Component/Render/FormattableMarkup.php(232): Drupal\Component\Render\FormattableMarkup::placeholderEscape()	
#3 /core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php(195): Drupal\Component\Render\FormattableMarkup::placeholderFormat()	
#4 /core/lib/Drupal/Component/Utility/ToStringTrait.php(15): Drupal\Core\StringTranslation\TranslatableMarkup->render()	
#5 /core/lib/Drupal/Core/Messenger/Messenger.php(54): Drupal\Core\StringTranslation\TranslatableMarkup->__toString()	
#6 /core/lib/Drupal/Core/Messenger/Messenger.php(46): Drupal\Core\Messenger\Messenger->addMessage()	
#7 /modules/fieldclone/src/FieldCloner.php(40): Drupal\Core\Messenger\Messenger->addError()	
#8 /modules/fieldclone/fieldclone.module(20): Drupal\fieldclone\FieldCloner::prepareEntity()	
#9 /core/lib/Drupal/Core/Entity/EntityForm.php(393): fieldclone_entity_prepare_form()	
#10 /core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Entity\EntityForm->Drupal\Core\Entity\{closure}()	
#11 /core/lib/Drupal/Core/Entity/EntityForm.php(394): Drupal\Core\Extension\ModuleHandler->invokeAllWith()	
#12 /core/lib/Drupal/Core/Entity/EntityForm.php(128): Drupal\Core\Entity\EntityForm->prepareInvokeAll()	
#13 /core/lib/Drupal/Core/Entity/ContentEntityForm.php(287): Drupal\Core\Entity\EntityForm->init()	
#14 /core/lib/Drupal/Core/Entity/EntityForm.php(96): Drupal\Core\Entity\ContentEntityForm->init()	
#15 [internal function]: Drupal\Core\Entity\EntityForm->buildForm()	
#16 /core/lib/Drupal/Core/Form/FormBuilder.php(531): call_user_func_array()	
#17 /core/lib/Drupal/Core/Form/FormBuilder.php(278): Drupal\Core\Form\FormBuilder->retrieveForm()	
#18 /modules/autosave_form/src/Form/AutosaveFormBuilder.php(97): Drupal\Core\Form\FormBuilder->buildForm()	
#19 /core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm()	
#20 /modules/inline_documentation/inline_documentation.module(241): Drupal\Core\Entity\EntityFormBuilder->getForm()	
#21 /modules/inline_documentation/inline_documentation.module(181): inline_documentation_get_node_form()	
#22 /core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(360): inline_documentation_page_bottom()	
#23 /core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()	
#24 /core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(361): Drupal\Core\Extension\ModuleHandler->invokeAllWith()	
#25 /core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(150): Drupal\Core\Render\MainContent\HtmlRenderer->buildPageTopAndBottom()	
#26 /core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()	
#27 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()	
#28 /core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()	
#29 /vendor/symfony/http-kernel/HttpKernel.php(164): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()	
#30 /vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()	
#31 /core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()	
#32 /core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()	
#33 /core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()	
#34 /core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()	
#35 /core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()	
#36 /core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()	
#37 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()	
#38 /core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()	
#39 /index.php(19): Drupal\Core\DrupalKernel->handle()	
#40 {main}	

Am I doing anything wrong ,or it just simple does not work?

πŸ› Bug report
Status

Active

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

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

Comments & Activities

  • Issue created by @coaston
  • πŸ‡©πŸ‡ͺGermany geek-merlin Freiburg, Germany

    Thanks for reporting this! And best karma points for the backtrace.

    #7 /modules/fieldclone/src/FieldCloner.php(40): Drupal\Core\Messenger\Messenger->addError()	
    #8 /modules/fieldclone/fieldclone.module(20): Drupal\fieldclone\FieldCloner::prepareEntity()	
    

    This means that the module wants to report an error, but the error reporting seems broken.
    I'm not currently using this, so no idea what it is, but patches appreciated.
    (You may study the source and guess a fix or try to avoid erroneous usage in the first place.)

Production build 0.71.5 2024