There currently isn't a method to allow error messages that link to the entity containing unique data. We want to link to the entity so users can either correct the information or report a case where duplicate data is actually valid.

The upcoming patch adds an [existing-entity-label] and [existing-entity-link] tokens. It also supports field collections and referencing the actual entity containing duplicate data instead of the field collection entity itself.

For example, set the Custom error message to

Email address ([value]) already exists on [existing-entity-link]., and Email address (test@example.com) already exists on <a href="/node/2">Example Person</a>. will be returned.

Comments

deviantintegral’s picture

Status: Active » Needs review
StatusFileSize
new2.65 KB
g089h515r806’s picture

Status: Needs review » Fixed

commited.
I made a small change to prevent "Strict warning: Only variables should be passed by reference":

from

      $entity_type = reset(array_keys($matched_entities));

to

      $entity_types = array_keys($matched_entities);
      $entity_type = reset($entity_types);

Status: Fixed » Closed (fixed)

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