Problem/Motivation
you get the whole page in errors when validating entities with constraint on entity level

Steps to reproduce
1. create constraint on entity level
2. add the entity to the inline form
3. select parameters under which validation will fail
Proposed resolution
rewrite validation
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | inline_entity_form-3358843-13.patch | 483 bytes | snguemae |
| #3 | 3358843-fix-multiple-duplicated-error-while-validating-entity.patch | 1.37 KB | oleh.tarasiuk |
| Знімок екрана 2023-05-08 о 13.15.49.png | 182.98 KB | oleh.tarasiuk |
Issue fork inline_entity_form-3358843
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:
- 8.x-1.x
changes, plain diff MR !69
- 3358843-multiple-duplicated-messages
changes, plain diff MR !68
Comments
Comment #2
oleh.tarasiuk commentedComment #3
oleh.tarasiuk commentedComment #9
podarokComment #11
geek-merlinBulk reopen.
Comment #12
geek-merlinReview: The code change in the MR replaces validation by the entity display with entity validation.
A profound change like this needs a lot more elaboration.
Comment #13
snguemae commentedHello, After applying the patch from #46, I still experienced the duplicate error message issue. The patch fixes the entity-level validation duplication, but the error message still appears twice: once on the parent fieldset and once on the bundle select element itself.
I created an additional patch that prevents this display-level duplication by adding #error_no_message => TRUE to the bundle select element. This property prevents the error from being rendered on the select element while it still displays on the parent fieldset, avoiding the duplicate message.
The attached patch resolves this remaining issue and works in conjunction with the existing fix.