Details
-
Bug
-
Resolution: Fixed
-
High
-
3.0.5, 2.5.12
-
None
Description
When you add a Custom Block with select attribute and NotBlank validator, that contains the choice with value 0 and this choice selected, validation will fail.
Steps to reproduce
1. Clean installation of eZ Platform 2.5 / 3.0
2. Create a new custom block testblock in ezplatform.yml:
ezplatform_page_fieldtype: blocks: testbblock: name: 'Test Block' thumbnail: '/bundles/ezplatformadminui/img/ez-icons.svg#contentlist' views: testblock: # template: 'blocks/testblock.html.twig' on 3.0 template: 'AppBundle:blocks:testblock.html.twig' name: 'Default block template' attributes: select: type: select options: multiple: false choices: 'Option 1': 0 'Option 2': 1 validators: not_blank: message: Please provide a valid option
3. Create a template file for the block
src/AppBundle/Resources/views/blocks/testblock.html.twig (3.0: templates/blocks/testblock.html.twig)
Test Block
4. Create a new Landing Page, put Test Block inside, and choose "Option 1".
Result
Block validation will fail.
Expected Result
Block will validate successfully.