Hi.

I have a content type using a multivalued taxonomy-term field using entity reference.

My user prefers to add new terms to the taxonomy directly from the node creation window.

Inline entity form is almost doing everything we need except one thing: we dont want duplicate values for the taxonomy terms.

For example: if there is the taxonomy term "fruit" we dont want it to be duplicated and it must keep only one term named "fruit" at all.

I can make the taxonomy core interface respect this kind of validation using the module "field_validation" (https://drupal.org/project/field_validation) and it's submodule "property validation".

But when I create a new term using inline entity form the rule is not being checked.

Is there a way to integrate both modules or another possible approach to achieve what I need?

Regards,
Gilsberty Boscolo

Comments

Category:feature» support

Changing the category.

Title:Is it possible to integrate this module with "field/property validation"?Allow the module to work on subforms
Project:Inline Entity Form» Field validation
Version:7.x-1.3» 7.x-2.x-dev
Category:Support request» Bug report
Issue summary:View changes

field_validation_validator::set_error() documents that it doesn't work on subforms such as the IEF one:

<?php
 
//We support two methods to set error: using form_set_error provided by form api, using errors provided by field api.
  //form_set_error does not work correctly when a sub form embed into another form;
  //errors does not work correctly when current field does not support hook_field_widget_error.
 
if (empty($this->rule->settings['errors'])) {
   
form_set_error($error_element, $error_message);
}
?>

So it needs to start respecting the field form's #parents.

This is a bug of Drupal core, Drupal core does not support it very well.