Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-31954

Fatal Error in RichText XML validation

    XMLWordPrintable

    Details

      Description

      In case of RichText XML validation fails, fatal error displayed:

      Argument 2 passed to Symfony\Component\Validator\Util\PropertyPath::append() must be of the type string, null given, called in /app/vendor/ezsystems/ezplatform-content-forms/src/lib/Validator/Constraints/FieldValueValidator.php on line 92 [in vendor/symfony/validator/Util/PropertyPath.php:34]
      

      The simplest way to reproduce it with custom tags:

      STR

      • Create new custom tag with 2 attributes:
        test:
                    template: '@ezdesign/custom_tag/test.html.twig'
                    icon: '/assets/build/shared/images/custom-tag-icons.svg#test'
                    is_inline: false
                    attributes:
                        test_one:
                            type: string
                            default_value: ''
                            required: false
                        test_two:
                            type: string
                            default_value: ''
                            required: false
        
      • Edit any content with richtext and add custom tag with both attributes filled.
      • Publish content
      • remove custom tag attribute:
        test:
                    template: '@ezdesign/custom_tag/test.html.twig'
                    icon: '/assets/build/shared/images/custom-tag-icons.svg#test'
                    is_inline: false
                    attributes:
                        test_one:
                            type: string
                            default_value: ''
                            required: false
        
      • Edit same content object, but didn't change richtext field
      • Click Publish

      Actual Result
      Fatal Error displayed

      Expected Result
      Error message displayed near RichText field:

      Validation of XML content failed: Unknown attribute 'test_two' of RichText Custom Tag 'test'
      

      PRs:
      https://github.com/ezsystems/ezplatform-content-forms/pull/34
      https://github.com/ezsystems/ezplatform-richtext/pull/164

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            diaborn Ivan Ternovtsiy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: