2

I am using two content types - test_parent & test_child In test_child there are two fields, both of type datetime And in test_parent there are two fields, week_no & 7 node references

I am using node_save to save a new node. After saving a node of parent type, and then saving the node of child type, i want to update the node it into the parent type.

I have completed creation of both nodes from code, and also i am able to update nid in parent type from code.

The problem is, the change in db is getting reflected in db but not on drupal node view. Even if i edit the node from drupal, it's showing -none- selected in node reference.

Please help.

apaderno
  • 28,547
  • 16
  • 75
  • 90
nikunj
  • 402
  • 5
  • 9
  • More details needed. Is the change not reflected within the same page cycle only or also after a reload? Could you edit your question to show the code you use to update the parent? – Henrik Opel Mar 30 '10 at 23:02
  • yes on page reload even. – nikunj Apr 01 '10 at 14:03
  • 1
    By the way, thanx Henrik, got it solved. After updating a node from code, i cleared the cache related to that node. I checked the node edit code in core module, and got the answer from them. Thanx anyways. – nikunj Apr 01 '10 at 14:04
  • You should post that as answer and then accept it. That way people looking at the same problem will find the actual solution. – berkes Dec 15 '11 at 15:20

1 Answers1

0

Two modules that can help with this kind of thing...

http://drupal.org/project/cnr

http://drupal.org/project/noderelationships

I was going to suggest to be careful you're creating the nodes and applying the relationships through the proper Drupal API channels, but it sound like it was a node caching issue.

doublejosh
  • 5,548
  • 4
  • 39
  • 45