The Entity Reference View Widget ignores the setting of the 'Required' checkbox on the field settings form and allows a node to be saved with no entity reference selected. I tested and confirmed this issue on a vanilla Drupal 7.17 setup with only this module's dependencies installed.

Comments

semanthis’s picture

Same problem here with the 7.x-1.x-dev-Version. I can't even find where the problem could come from. Any help would be appreciated.

simon georges’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev

Changing version, as per #1.

johnnybgoode’s picture

Status: Active » Needs review
StatusFileSize
new1.12 KB

Attached is a quick patch which fixes the issue.

It would probably be better to figure out what's really causing the problem here though.

artusamak’s picture

Here is a version with some code cleaned and comments.

Hmm it's not enough, if you use ajax filters it breaks the "required" check.

haver’s picture

The patch from #4 is not working. it's not allow passing of form validation.
Even if entity reference option selected, it is not allowing form submit, and
asking to select option.

bojanz’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Needs review » Fixed

This issue has been fixed in the 2.x branch, a rewrite that aimed to solve all current problems with the 1.x branch.
The 1.x branch won't be getting further non-critical commits.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.