Is it possible to disallow duplicate node references in a multiple node reference field?
The node reference field I use, is part of a multigroup.

Comments

markus_petrux’s picture

Status: Active » Fixed

You need to do this using custom validation code. You can try appending an #element_validate callback to node reference fields, or you can do it in hook_nodeapi('validate'). Please, search the Drupal APIs reference for more details.

http://api.drupal.org

You can probably add #element_validate callback (or #validate callback) using hook_elements() altering the elements implemented by node reference module widgets. You may alter the weight of your module to a number higher than nodereference module weight (do this in hook_enable).

tomsm’s picture

Category: support » feature

Thank you for the information.
Maybe "No duplicates" for multiple CCK fields would be a good feature request?

markus_petrux’s picture

I'm afraid to say yes to most of the feature requests that land in the CCK queue (even if someone else provides the patches) because almost everyone but me here is focused on D7, and I do have more work than I really can.

I would even say CCK2 is somehow feature frozen for that reason.

Status: Fixed » Closed (fixed)

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