Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I am trying to implement mutual one to one relation for a node reference field. I mean that in my case, the node i reference have to be referenced just one time. Is there any way to make this sort of relation with the actual version of References?
I ve found an old module project on drupal.org wich is exactly what i am looking for, but for Drupal 6 and CCK Node Reference field :
http://drupal.org/project/cck_reference_filter
Thanks in advance for your answer.
Regards,
herve.
Comments
Comment #1
herve CreditAttribution: herve commentedI ve worked on this issue for my own, i share my code because i think it could be a way to implement this functionnality. At the moment, my method is to using hook_query_alter so it could be used in a custom module, and you don't need to alter the references module.
Do you think this functionnality should be integrated in the references module? (in _node_reference_potential_references_standard function i suppose) Or should this functionnality should be integrated in a special module named one_to_one_references?
The data returned by my_module_one_to_one_reference_fields should be defined in a special hook, or/and with an UI.
Regards,
herve.