I am attempting to create fields that are node references to the same content type, but finding that the association only goes one way both in the settings page and how it actually functions. There is a workaround, listed at the bottom.

Here are the steps I follow, based on the ones on the module home page and modified to reflect what I did. Here, the type is the same, so instead of A & B I have A & A.

- enable the module at admin/build/modules
- Create content type A
- Create a node reference field, A1, on A pointing to content type A
- Create a node reference field, A2, on A pointing to content type A
- Go to the settings page at admin/settings/corresponding_node_references.
- Note that the available options are:
-- A with field A1 <==> A with field : A1
-- A with field A1 <==> A with field : A2
-- A with field A2 <==> A with field : A2

What I want is, the second option above (A:A1 <==> A:A2) and another option that does not appear, which should be A:A2 <==> A:A1. There should be a total of four options, not three.

The way this ends up (not) working:
- Create nodes X and Y of type A.
- Edit node X, edit field A2 to have a reference to node Y.
- View node X, observe the reference to node Y.
- Click link to view node Y.
- There is no corresponding reference back to X, in Y's field A1.

But,
- Empty out all node references in nodes X and Y.
- Edit node X, edit field A1 to have a reference to node Y.
- View node X, observe the reference to node Y.
- Click link to view node Y.
- There IS a corresponding reference back to X, in Y's field A2.

The workaround:

The table corresponding_node_references in the database indeed has the value "A*A1*A*A2". If I add a row "A*A2*A*A1", then the relationship between the fields does work both ways where adding a reference in either field does cause it to be set in the other one correctly. But the settings page doesn't display the relationship I added to the database.

If I am able to get some time I may look at a possible patch myself, but I wanted to at least report this. Thank you!

Comments

domidc’s picture

MMachnik you are correct.
This is a case the module does not support, the solution is indeed pretty simple to implement.
I ll include in the 6.10 release which will be planned for this weekend.

Thanks for the good documentation

domidc’s picture

Status: Active » Fixed

As from version 2.0 this bug is fixed

domidc’s picture

Status: Fixed » Closed (fixed)
attisan’s picture

Version: 6.x-1.9 » 7.x-4.22
Status: Closed (fixed) » Active

sorry to reopen this - but in 7.x this problem is back ;-)

could this be fixed please? or is it already fixed in the dev?

bazzly’s picture

deleted