This is a bit in the middle of a Support request and a Feature request.
I'm looking for some advice on the following use case:

I have a node type, with an entityreference field pointing to nodes of a different type. Now I've encountered that I can setup multiple references to the same node. This behavior is confusing my client and causes some unexpected results in various parts of the system. Therefore it would be nice to find a way to limit this, so that the client can't setup multiple references to the same node.

Looking around I did find the 'entityreference_unique' module, but that module does exactly not what it is supposed to do. What would be the proper way to handle this case? I've been thinking about adding a validation handler and trigger an validation error if this occurs, but that still doesn't prevent the client of adding the reference twice (he'll just get a nasty error). It would be quite a lot nice to be able to alter the data that is send to the auto complete and prevent this all together, but I can't seem to find a hook that can be used for this.

Any thoughts on how to implement this?

Comments

PieterDC’s picture