Problem/Motivation

Warning: Undefined array key "data-editor-embed-uuid" in paragraphs_inline_entity_form_entity_embed_values_alter() (line 85 of /home/machdwqx/example.com/modules/contrib/paragraphs_inline_entity_form/paragraphs_inline_entity_form.module) #0 /home/machdwqx/example.com/core/includes/bootstrap.inc(166): _drupal_error_handler_real()
#1 /home/machdwqx/example.com/modules/contrib/paragraphs_inline_entity_form/paragraphs_inline_entity_form.module(85): _drupal_error_handler()
#2 /home/machdwqx/example.com/core/lib/Drupal/Core/Extension/ModuleHandler.php(552): paragraphs_inline_entity_form_entity_embed_values_alter()
#3 /home/machdwqx/example.com/modules/contrib/entity_embed/src/Form/EntityEmbedDialog.php(844): Drupal\Core\Extension\ModuleHandler->alter()
#4 [internal function]: Drupal\entity_embed\Form\EntityEmbedDialog->submitEmbedStep()
#5 /home/machdwqx/example.com/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array()
#6 /home/machdwqx/example.com/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(112): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse()
#7 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
#8 /home/machdwqx/example.com/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#9 /home/machdwqx/example.com/vendor/symfony/http-kernel/HttpKernel.php(239): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#10 /home/machdwqx/example.com/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
#11 /home/machdwqx/example.com/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#12 /home/machdwqx/example.com/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#13 /home/machdwqx/example.com/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#14 /home/machdwqx/example.com/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#15 /home/machdwqx/example.com/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#16 /home/machdwqx/example.com/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#17 /home/machdwqx/example.com/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#18 /home/machdwqx/example.com/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#19 /home/machdwqx/example.com/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#20 /home/machdwqx/example.com/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#21 /home/machdwqx/example.com/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#22 /home/machdwqx/example.com/index.php(19): Drupal\Core\DrupalKernel->handle()
#23 {main}.

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:

Comments

nelo_drup created an issue. See original summary.

marcelovani’s picture

Hi @nelo_drup

Thanks for reporting.

In order for me to debug this I need some information.

1 - Can you please provide detailed steps to reproduce?
2 - Are you using other modules that could be conflicting and causing this error?
3 - Can you try it on a fresh Drupal installation?

slattery’s picture

Hi ,marcelovani

I get that error as well, Drupal 10.4 and PIEF 1.1.0-beta4. Not a fresh install. But grepping I can't find any other instance of this attribute key in modules or core. In the design, where would this attribute be populated? The closest attribute key in entity_embed would be the ''data-entity-uuid" key which is present in the 1.x and 2.x branches. But I'm not sure that would do what was intended, so I can't say a simple key replacement there would help to trigger the refresh intended in the alter hook function.

the key is presumed to be populated in the .module file here:

function paragraphs_inline_entity_form_entity_embed_values_alter(array &$values, ContentEntityInterface $entity): void {
  // Add dummy value to trigger a refresh of the embedded content preview.
  $values['attributes']['alt'] = $values['attributes']['data-editor-embed-uuid'];
}

Thank you!

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

miiimooo’s picture

Version: 8.x-1.1-beta4 » 8.x-1.x-dev
Assigned: Unassigned » miiimooo
Status: Active » Needs review

Pushed a commit that changes the array key used to the correct "data-entity-uuid" and resolves the PHP warning for me

  • 8982acad committed on 8.x-1.x
    Issue #3506282 by nelo_drup,miiimooo: Undefined array key "data-editor-...
marcelovani’s picture

Status: Needs review » Fixed

Thansk for the fix. PR merged.

Status: Fixed » Closed (fixed)

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