Problem/Motivation

An error was displayed when installing the module and applying the format to a display mode with a remote video media type. Strangely, there are also display modes where the error is not displayed.

The error message is as follows.

TypeError: Cannot access offset of type string on string in Drupal\media\Plugin\Field\FieldFormatter\OEmbedFormatter->settingsSummary() (line 328 of /app/web/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php).

#0 /app/web/modules/contrib/glightbox_media_video/src/Plugin/Field/FieldFormatter/GLightboxMediaRemoteVideoFormatter.php(357): Drupal\media\Plugin\Field\FieldFormatter\OEmbedFormatter->settingsSummary()
#1 /app/web/core/modules/field_ui/src/Form/EntityDisplayFormBase.php(439): Drupal\glightbox_media_video\Plugin\Field\FieldFormatter\GLightboxMediaRemoteVideoFormatter->settingsSummary()
#2 /app/web/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php(41): Drupal\field_ui\Form\EntityDisplayFormBase->buildFieldRow(Object(Drupal\field\Entity\FieldConfig), Array, Object(Drupal\Core\Form\FormState))
#3 /app/web/core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php(227): Drupal\field_ui\Form\EntityViewDisplayEditForm->buildFieldRow(Object(Drupal\field\Entity\FieldConfig), Array, Object(Drupal\Core\Form\FormState))
#4 /app/web/core/modules/field_ui/src/Form/EntityDisplayFormBase.php(213): Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm->buildFieldRow(Object(Drupal\field\Entity\FieldConfig), Array, Object(Drupal\Core\Form\FormState))
#5 /app/web/core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php(47): Drupal\field_ui\Form\EntityDisplayFormBase->form(Array, Object(Drupal\Core\Form\FormState))
#6 /app/web/core/lib/Drupal/Core/Entity/EntityForm.php(107): Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm->form(Array, Object(Drupal\Core\Form\FormState))
#7 /app/web/core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php(40): Drupal\Core\Entity\EntityForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#8 [internal function]: Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm->buildForm(Array, Object(Drupal\Core\Form\FormState), Object(Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage))
#9 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array(Array, Array)
#10 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(375): Drupal\Core\Form\FormBuilder->retrieveForm('entity_view_dis...', Object(Drupal\Core\Form\FormState))
#11 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(633): Drupal\Core\Form\FormBuilder->rebuildForm('entity_view_dis...', Object(Drupal\Core\Form\FormState), Array)
#12 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm('entity_view_dis...', Array, Object(Drupal\Core\Form\FormState))
#13 /app/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm), Object(Drupal\Core\Form\FormState))
#14 /app/web/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#15 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#16 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#17 /app/web/core/lib/Drupal/Core/Render/Renderer.php(637): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#18 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#19 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#20 /app/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#21 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#22 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /app/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /app/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#34 {main}

ENV: Drupal 10.5.2

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#3 glightbox_media_video-3541630.patch2.07 KBlevmyshkin

Comments

s-jack created an issue. See original summary.

s-jack’s picture

Category: Bug report » Support request

Changing the formatter for the Video URL field to Plain Text, saving it, and then resetting it to Glightbox Media Remote Video resulted in no errors being displayed.

levmyshkin’s picture

StatusFileSize
new2.07 KB

Hi s-jack, please, try this patch to solve your problem:

levmyshkin’s picture

Status: Active » Needs review

  • levmyshkin committed 3bb52550 on 1.0.x
    fix: #3541630 Prevent TypeError when the oEmbed loading setting is not...
levmyshkin’s picture

Status: Needs review » Fixed

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.

levmyshkin’s picture

Status: Fixed » Closed (fixed)