Every page view generates 10-20 warnings per accordion

Created on 21 June 2023, about 1 year ago
Updated 23 August 2023, 10 months ago

Current release generates 10-20 errors per accordion per page on view.

Warning: DOMDocument::loadHTML(): Tag drupal-entity invalid in Entity, line: 7 in Drupal\ckeditor_accordion\Plugin\Filter\CKEditorAccordion->process() (line 61 of /srv/drupal/drupal9/project/code/pantheon-d9/web/modules/contrib/ckeditor_accordion/src/Plugin/Filter/CKEditorAccordion.php)
#0 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /srv/drupal/drupal9/project/code/pantheon-d9/web/modules/contrib/ckeditor_accordion/src/Plugin/Filter/CKEditorAccordion.php(61): DOMDocument->loadHTML()
#3 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/filter/src/Element/ProcessedText.php(118): Drupal\ckeditor_accordion\Plugin\Filter\CKEditorAccordion->process()
#4 [internal function]: Drupal\filter\Element\ProcessedText::preRenderText()
#5 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
#6 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
#7 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
#8 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#9 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/field/EntityField.php(934): Drupal\Core\Render\Renderer->render()
#10 /srv/drupal/drupal9/project/code/pantheon-d9/web/modules/contrib/search_api/src/Plugin/views/field/SearchApiEntityField.php(259): Drupal\views\Plugin\views\field\EntityField->render_item()
#11 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1170): Drupal\search_api\Plugin\views\field\SearchApiEntityField->render_item()
#12 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/views.theme.inc(238): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender()
#13 [internal function]: template_preprocess_views_view_field()
#14 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Theme/ThemeManager.php(287): call_user_func_array()
#15 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
#16 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#17 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1746): Drupal\Core\Render\Renderer->render()
#18 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(777): Drupal\views\Plugin\views\field\FieldPluginBase->theme()
#19 [internal function]: Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow()
#20 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
#21 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
#22 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
#23 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#24 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(716): Drupal\Core\Render\Renderer->render()
#25 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(582): Drupal\views\Plugin\views\style\StylePluginBase->renderFields()
#26 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(473): Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping()
#27 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(2169): Drupal\views\Plugin\views\style\StylePluginBase->render()
#28 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/ViewExecutable.php(1538): Drupal\views\Plugin\views\display\DisplayPluginBase->render()
#29 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/views/display/Block.php(131): Drupal\views\ViewExecutable->render()
#30 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/ViewExecutable.php(1635): Drupal\views\Plugin\views\display\Block->execute()
#31 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay()
#32 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/views/src/Plugin/Block/ViewsBlock.php(59): Drupal\views\Element\View::preRenderViewElement()
#33 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php(106): Drupal\views\Plugin\Block\ViewsBlock->build()
#34 [internal function]: Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender()
#35 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#36 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/layout_builder/src/SectionComponent.php(90): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#37 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/layout_builder/src/Section.php(88): Drupal\layout_builder\SectionComponent->toRenderArray()
#38 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(316): Drupal\layout_builder\Section->toRenderArray()
#39 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(275): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildSections()
#40 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(340): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple()
#41 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/node/src/NodeViewBuilder.php(24): Drupal\Core\Entity\EntityViewBuilder->buildComponents()
#42 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(282): Drupal\node\NodeViewBuilder->buildComponents()
#43 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(239): Drupal\Core\Entity\EntityViewBuilder->buildMultiple()
#44 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build()
#45 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
#46 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
#47 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
#48 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#49 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->render()
#50 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#51 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(243): Drupal\Core\Render\Renderer->executeInRenderContext()
#52 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#53 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#54 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#55 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#56 /srv/drupal/drupal9/project/code/pantheon-d9/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#57 /srv/drupal/drupal9/project/code/pantheon-d9/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#58 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#59 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#60 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#61 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#62 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#63 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#64 /srv/drupal/drupal9/project/code/pantheon-d9/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#65 /srv/drupal/drupal9/project/code/pantheon-d9/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#66 /srv/drupal/drupal9/project/code/pantheon-d9/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#67 {main}

Filling up my logs with errors for every page view for all visitors and users.

πŸ› Bug report
Status

Active

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States emptyvoid

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

Comments & Activities

  • Issue created by @emptyvoid
  • πŸ‡ΊπŸ‡ΈUnited States emptyvoid

    Attempting to create a batch with 8.x-dev the repository doesn't appear actually have all of the code in the official release. So I can't create a patch.

    ckeditor_accordion/src/Plugin/Filter/CKEditorAccordion.php

    -- Line 60
    From

    // Load the text into a dom object.
        $dom = new \DOMDocument();
        $dom->loadHTML(mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8'));
        $xpath = new \DOMXPath($dom);
    

    to line 60

    // Load the text into a dom object.
        $dom = new \DOMDocument('1.0');
        libxml_use_internal_errors(true);
        $dom->loadHTML(mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8'));
        libxml_clear_errors();
        $xpath = new \DOMXPath($dom);
    

    This properly validates the DOM object and suppresses false negatives for invalid entities.

  • @emptyvoid opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States emptyvoid

    Created a branch with missing source code and fix for this error.

    https://git.drupalcode.org/project/ckeditor_accordion/-/merge_requests/8

  • πŸ‡ΊπŸ‡ΈUnited States emptyvoid

    oh I guess I can't push. :(

  • πŸ‡³πŸ‡±Netherlands llewellyn.dawson

    I am also getting this error on version 2.0.3 where we have content with xml language tags.

    Warning: DOMDocument::loadHTML(): Attribute xml:lang redefined in Entity, line: 1 in ckeditor_accordion/src/Plugin/Filter/CKEditorAccordion.php on line 61

    I have tried the fix from @emptyvoid and it resolves the issue.

    Updated from line 59 to 64:

    // Load the text into a dom object.
        $dom = new \DOMDocument();
        libxml_use_internal_errors(true);
        $dom->loadHTML(mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8'));
        libxml_clear_errors();
        $xpath = new \DOMXPath($dom);
  • πŸ‡³πŸ‡±Netherlands llewellyn.dawson

    This issue is caused by the patch for issue 3124167 πŸ“Œ Provide an accessible variant Needs review

    I have created a updated on the patch that fixes this issue and is available on 3124167 #30 πŸ“Œ Provide an accessible variant Needs review

  • πŸ‡ΊπŸ‡ΈUnited States emptyvoid

    Confirmed llewellyn.dawson on the 2.0-dev branch this patches and suppresses the errors!

Production build 0.69.0 2024