Warning: DOMDocumentFragment::appendXML() when input is not normalized

Created on 9 October 2024, 3 months ago

When HTML input is not properly normalized, many XML errors can result. This is appearing when using the accordion component as part of the uswds_ckeditor_integration β†’ module, which switched from ckeditor5_embedded_content to embedded_content in the most recent release.

Example error:

Warning: DOMDocumentFragment::appendXML(): ^ in Drupal\embedded_content\Plugin\Filter\EmbeddedContent->process() (line 104 of /app/web/modules/contrib/embedded_content/src/Plugin/Filter/EmbeddedContent.php)

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States srdtwc Skokie, IL

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

Merge Requests

Comments & Activities

  • Issue created by @srdtwc
  • Merge request !3Normalize fragment before appending β†’ (Open) created by srdtwc
  • Pipeline finished with Failed
    3 months ago
    Total: 184s
    #305574
  • πŸ‡ͺπŸ‡ΈSpain nuez Madrid, Spain

    I'm not sure if this should be the responsibility of the embedded_content module or the plugin creating the markup.

    However I would like to be able to reproduce the issue on my local environment: Could you provide the exact steps to reproduce this issue, with module version numbers, themes and modules installed,

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States srdtwc Skokie, IL

    Drupal 10.3.6
    'drupal/uswds_ckeditor_integration:3.0.2'
    'drupal/embedded_content:2.0.1'

    Basic HTML text format uses Embedded Content in CKEditor.

    1. Create a new node (Basic Content)
    2. Click the "Embedded Content" button in the CKEditor toolbar
    3. Select "Accordion" for content type
    4. Enter a heading and body, click "Embed"
    5. Save the new node
    6. Errors appear (see screenshot)

  • πŸ‡ͺπŸ‡ΈSpain nuez Madrid, Spain
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024