Since Drupal 7 allows us to define fields not only to nodes, I would like to see this module working on fields in general and not only for nodes (now you need to setup this functionability per node or per node type.

For example: I've got a file with fields and I want to make one of those fields to have unique values.

Comments

lindsayo’s picture

I second this request. I need Employee ID on user profiles and need it to be unique. Thanks for your work on this module! I've found it useful on several projects. :)

vito_swat’s picture

+1. I need unique 'display name' text field for users.

alliax’s picture

Subscribing, I'd need unique adsense id in an adsense revenue sharing site for user profiles, so they can't put in existing adsense id. Thanks if you get around to do it.

Pomliane’s picture

It would be nice to have unique fields in comments too. :)

univate’s picture

I agree, this seems like the logical progression for this module.

arithmetric’s picture

Status: Active » Needs work

I like this idea, and will be looking into it as time permits. I'd welcome patches from others as well. I think this may be related: #1185904: Evaluate using EntityFieldQuery for content queries

derhasi’s picture

That's a great idea ;)

I guess to implement this, hook_field_attach_validate() is the only way, instead of using hook_node_validate().

@see http://api.drupal.org/api/drupal/includes--common.inc/function/entity_fo...

Using field API functions should ease lot here, @see #1163924: Error with Node Reference Module.

edit: I hope to solve a similar issue (#1212766: promote taxonomy_path/entity_path to full module) soon. There we almost figured out, how to place the configuration form, for the entity bundles...

pcambra’s picture

suscribe, I'd say one of the biggest issues here is how to place the settings form per bundle, as some bundles don't have edit form themselves and afaik there's no straight way to get the admin url for those that have.

TommyChris’s picture

sub

johnv’s picture

Title: Enable this module to work with field in general, not only on nodes » Support (Entity) Fields in general, not only on nodes
hass’s picture

I need this for validation of a user textfield that is used for a membership-id and that must be unique... :-) Any timeplans for this case resolution?

HLopes’s picture

My guess is not so soon, as the module as-is relies on hook_node_validate, and there is no such thing as hook_entity_validate.

Maybe it should go down onto the field validation, instead of up to entity validation?

Anyway, +1 for this feature.

hass’s picture

I just tested field_validation module today and it works great. If I were you, I would stop re-inventing the wheel... just write a migration module for D6 users to field_validation and discontinue this module here to join forces over there... With this in mind I would be happy to be able to unsubscribe from this case or if we close it and point all users to field_validation... aka WONT FIX

adammalone’s picture

I would be interested in writing a unique_entity module. At present I have a unique comments module - http://drupal.org/project/unique_comments that I've written to address some desire in the community to have unique comments. If people think a unique_entity module would be useful I'd be attentive to discussion about it.

prezaeis’s picture

any updates on this? im trying to get profile2 fields validated and nothing seems to work :(

josebc’s picture

+1

nimek’s picture

+1

Yuri’s picture

Issue summary: View changes

Any progress on unique fields for custom entities, i.e. ECK entities?

nimek’s picture

If you look for more generic solution please look on my project entity unique https://www.drupal.org/sandbox/nimek/2704251

AstonVictor’s picture

Status: Needs work » Closed (outdated)

I'm closing it because the issue was created a long time ago without any further steps.

if you still need it then raise a new one.
thanks