2

I have a entity-reference field that enables multiple-references (cardinality is set to -1). The problem is that it allows multiple 'same' references => it is possible to save two references to one specific node.

I know I can limit that using my own validation function but I have this feeling that there has to be easier way (e.g. some settings that I don't know about).

If there's none then sorry for useless question.

| improve this question | | | | |
2

I don't think the Entity Reference module ships with this feature. But the entityreference unique module should be sufficient for your need. It is in alpha mode, so I would check the issue queue to see if there are any security/critical issues with it before using it on a production env.

| improve this answer | | | | |
  • I'll look how they handle it and implement it my way probably. Anyway, thanks. – Petrroll Apr 4 '14 at 20:06
0

Looking at entityreference unique module (thanks awm) I discovered that the best way to implement it is using entityreference behavior plugin, to be more specific its validate function.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.