Problem/Motivation

If only one invalid entity is referenced the validation always pass successfully.

Steps to reproduce

1. install a vanilla Drupal 7.x
2. install entityreference
3. add a multiple entityreference field referencing users on the basic page content type
4. add two users
5. add a basic page, reference the previously created users and save
6. edit the page, open admin > people in another tab and delete one of the users
7. in the page editing, save without changing anything
8. notice that there will be a form error
9. remove the not deleted user from entityreference field
10. save

Expected result:
an error should be raised because the user is not valid

Actual result:
the page is saved without errors

Comments

peximo created an issue. See original summary.

peximo’s picture

Attached patch should fix the issue.