Details
-
Bug
-
Resolution: Done
-
Medium
-
3.0.0, 3.1.0, 2.5.13
-
None
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