Create a node revision programatically
Hi List, I want to create a new revision of a node from a module. I could not find a function for that in the api docs (D6). I figured out (by poking at node.module) I could just set $node->revision to TRUE and set $node->log to something meaningful and it works. But since I did not find any documentation about this I thought I should ask here before breaking anything. Is my approach correct or will it do something "surprising"? Regards, Eric
I did it last week and it seems to work. No problem for me. Brice 2010/11/12 Eric Schaefer <eric.schaefer@eas-consulting.de>
Hi List,
I want to create a new revision of a node from a module. I could not find a function for that in the api docs (D6). I figured out (by poking at node.module) I could just set $node->revision to TRUE and set $node->log to something meaningful and it works. But since I did not find any documentation about this I thought I should ask here before breaking anything. Is my approach correct or will it do something "surprising"?
Regards, Eric
That's the approach I took several months ago. Works for me. Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. ________________________________ From: Eric Schaefer <eric.schaefer@eas-consulting.de> To: Drupal Development Mailing List <development@drupal.org> Sent: Fri, November 12, 2010 8:34:47 AM Subject: [development] Create a node revision programatically Hi List, I want to create a new revision of a node from a module. I could not find a function for that in the api docs (D6). I figured out (by poking at node.module) I could just set $node->revision to TRUE and set $node->log to something meaningful and it works. But since I did not find any documentation about this I thought I should ask here before breaking anything. Is my approach correct or will it do something "surprising"? Regards, Eric
Hi, even though there is no field this is way that you do it. Gordon. On 13/11/2010, at 12:34 AM, Eric Schaefer wrote:
Hi List,
I want to create a new revision of a node from a module. I could not find a function for that in the api docs (D6). I figured out (by poking at node.module) I could just set $node->revision to TRUE and set $node->log to something meaningful and it works. But since I did not find any documentation about this I thought I should ask here before breaking anything. Is my approach correct or will it do something "surprising"?
Regards, Eric
participants (4)
-
Brice -
Eric Schaefer -
Gordon Heydon -
nan wich