I am using an Inline entity form of the content type "Organization" that is placed inside a content type that I have called "Contact"

If I create a property validation rule to avoid creating the same organisation (validating the title), this works fine if I just try and create two new organisations by just adding them via "add content", so it seems that Field validation is working fine. However If I use the inline entity form , I can add a new node (which doesn't actually create it yet) and when I submit the contact it doesn't complain and just goes ahead and creates a new organisation with the same title.

So when I submit the "Contact" with a newly added "Organisation" that already exists this does not do the field validation.

I am not sure if this is a bug with Field Validation (http://drupal.org/project/field_validation) or IEF

Thanks...and once again this is a really great module

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

Project: Inline Entity Form » Field Validation
Version: 7.x-1.1 » 7.x-2.x-dev

IEF invokes all field attach hooks just like a normal form would, so I'm unsure why there would be a difference in the behavior.
Let's ask the Field validation maintainers.

g089h515r806’s picture

It is a bug of Field validation, but I could not able to fix it.
It is too difficult to fix it.

g089h515r806’s picture

Issue summary: View changes

added link to field validation module

chrislabeard’s picture

Issue summary: View changes

Any news on this?

michaellander’s picture

Project: Field Validation » Inline Entity Form
Version: 7.x-2.x-dev » 7.x-1.x-dev
FileSize
20.66 KB
18.82 KB

This appears to be an Inline Entity Form issue, as the field validation works fine for non-IEF entity reference widgets.

As a test, I set up the 'Number of selections' validator, then inside of:

field_validation_number_of_selections_validator->validate

I dumped out $this->items and attached screenshots of both.

I'm not necessarily sure this is a bug, or rather just a conflict of function.

bojanz’s picture

Category: Bug report » Support request
Status: Active » Fixed

Another issue says that field validation works fine if it's configured to use the "Set errors using field API " option.

Reopen with a patch if any additional issues exist.

michaellander’s picture

Category: Support request » Bug report
Status: Fixed » Active

I just tried again. Issue still exists. I checked 'Set errors using field API". I tried both the field_validation prod and dev branch. I also am using IEF dev. The issue still appears to have to do with IEF doing things differently when creating new entities. I have not yet tested it when selecting existing entities only.

Shyghar’s picture

Hi,
I need an info. Where can I find the "Set errors using field API" options? I'm searching it to test if it will works but I don't know where to find it : (

sktiwari’s picture

same problem. Have any one found the solution for this?