Problem/Motivation
When making the boolean field as "Require on Publish", the field doesn't throw any validation errors when boolean field is not checked and node is published.
Steps to reproduce
- Add a boolean field on any content type.
- Check "Require on Publish" checkbox and save.
- Now add and publish the node without checking the boolean field.
- Observe that the node is getting published without any validation errors.
Proposed resolution
Add a check for boolean fields in RequireOnPublishValidator.php to skip validation only when the boolean field is checked.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | BooleanFieldSetting.png | 121.5 KB | divya.sejekan |
| #8 | BeforeFix.png | 144.89 KB | divya.sejekan |
| #8 | AfterFix.png | 164.88 KB | divya.sejekan |
| #3 | require_on_publish-boolean_field_bug-3412227-3.patch | 750 bytes | vatsalkhanna |
Issue fork require_on_publish-3412227
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
vatsalkhanna commentedComment #3
vatsalkhanna commentedAttached the patch.
Comment #4
markdorisonPlease re-roll this change in a merge request so that GitLabCI tests will run against it. Thank you!
Comment #5
bakopComment #7
bakopFix placed in a merge request.
Everything looks good !
Comment #8
divya.sejekan commentedVerified with MR! 14 . The issue is fixed , now the Node is not getting published if the boolean field (which has Require on publish set ) is kept unchecked.
Testing Steps :
Add a boolean field on any content type.
Check "Require on Publish" checkbox and save.
Now add and publish the node without checking the boolean field.
Observe that the node is getting published without any validation errors.
Moving to RTBC++
Comment #10
markdorison