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

HTML code gets removed from the Custom tag's string attribute

    XMLWordPrintable

Details

    Description

      Currently, in Ibexa DXP v4 you can't store HTML tags inside a string attribute of a Custom Tag. All HTML tags are purged on save.
      HTML tags are saved normally in v3.3.

      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 newly created "Test Tag" custom tag inside, with string_with_html attribute set to:

      <script>some_script</script>
      

      And publish it.
      4. Go back to previously published content, edit it and check saved value of the string_with_html attribute.

      Result:
      The value will be empty

      Expected result:

      <script>some_script</script>
      

      Designs

        Attachments

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: