This is weird, and I'm still investigating it. I'm mostly creating this ticket so that once I've figured out what's going wrong, I can have a ticket number to apply the patch to.
A) I've got a field (field_left) on two node types, and it points to a field (field_right) on one node type.
B) I create a node (#15, say), and point the field_left at existing node 13. When I save, the field_left that I just entered pointing to node 13 is blank... but the field_right on node 13 is successfully pointing back to node 15.
C) If I then *edit* node 15 and set the field_left to point to existing node 13 again, the problem does not recur and the data is correct in both ways.
It seems, at this point, to be a problem with having node 15's field_right calling _backreference_old_values_remove().
Comments
Comment #1
jcfiala commentedAh - problem is related to doing a node_load on the right node type before removing the old value. Because of the content cache, the loaded node still contains the old (null) data of the node, and not the updated new data.
For my own reference, here's the change I made:
Of course, I need to create a test before submitting this fix.
Comment #2
techgirlgeek commentedHaving the same issue(s).
Comment #3
techgirlgeek commentedApplied your change on my implementation and things miraculously began to work.
Looking forward to the patch. :-)
===========================
Update -- 7/20/2010:
- Noticed that for one of our content types, the back reference only seemed to work from the the content type that had the listing of multiple nodes. However, if we go to the each node that references the "main" content type, the new references don't show up on the "main" content type.
-- Example: Owner has a reference to a content type, say white papers. If you edit the node references for the owner and add 3 white papers, then go to each white paper, it will properly list the owner. However, if we go to each white paper and reference the owner, we go back to the owner and only see one white paper.
Comment #4
jcfiala commentedI want to do a patch for this, but I'm having a devil of a time reproducing this on a clean environment. Any suggestions/help with setting up a test would be a lot of help.
Comment #5
danrasband commentedI'm having the same problem. Subscribing.
Comment #6
techgirlgeek commentedAnything I can do to help, please let me know. I can reproduce on the project I'm working on. (You know the one.) As of right now we are having to manually add the references on both nodes, since with the fix in place it doesn't seem to update the referenced node any longer. But nothing is disappearing, so definitely an improvement.
-TechGirlGeek
Comment #7
emman31 commentedI have the exact same problem:
Type A has 2 fields:
-> field_1:
---> nodereference autocomplete
---> not multiple
---> Referencable type: Type A
-> field_2
---> nodereference autocomplete
---> multiple Unlimited values
---> Referencable type: Type A
Both field are controled by a conditionnal field so that both can't be filled at same time.
I have Content #1 of Type A (both fields empty)
Case 1:
Create Content #2 of type A, filling field_2 with Content #1, save
Content #1 -> field_1 is correctly filled with Content #2
Content #2 -> field_2 is empty.
Case 2:
Create Content #2 of type A, filling field_1 with Content #1, save
both references are made correctly