Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-5055

Using HTML Code in a Custom Tag attribute might end in "Validation of XML content failed" error

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Customer request, 4.4.2
    • 4.4.0, 4.3.3
    • None
    • Yes

    Description

      Currently, in Ibexa DXP v4 you attempt to store some HTML in a string attribute of a Content Type you will receive an error on attempting to save the changes.

      Steps to reproduce
      1. Clean installation of Ibexa DXP v4.3/4.4
      2. Create a custom tag with a string attribute:
      config/packages/ibexa.yaml

      ibexa:
          system:
              admin_group:
                  fieldtypes:
                      ezrichtext:
                          custom_tags: [ testtag ]
                          toolbar:
                              custom_tags_group:
                                  buttons:
                                      testtag:
                                          priority: 5
      
      ibexa_fieldtype_richtext:
          custom_tags:
              testtag:
                  template: 'custom_tags/testtag.html.twig'
                  icon: '/bundles/ezplatformadminui/img/ez-icons.svg#information'
                  attributes:
                      string_with_html:
                          type: string
                          required: true
      
      

      templates/custom_tags/testtag.html.twig

      <h1>Test Tag</h1>
      <div>
          {{ params.string_with_html|raw }}
      </div>
      

      3. Create a Content with a Richtext field and place the newly created "Test Tag" custom tag inside, with string_with_html attribute set to:

      <b>I'm bold!</b>
      

      And publish it.

      Result:

      Validation of XML content failed:
      Error in 80:0: Element section has extra content: para 

      Expected result:

      Content is published.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              mateusz.bieniek@ibexa.co Mateusz Bieniek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: