Created
March 24, 2011 21:32
-
-
Save ramlev/885942 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For inserts, we need a new item_id for the item. See the comment a few lines | |
// below, before we call the content_<op> function. | |
if ($sOperation === 'insert') { | |
$aNodeRevision = array( | |
'nid' => $oNode->nid, | |
'uid' => $oNode->uid, | |
'title' => '', | |
'body' => '', | |
'teaser' => '', | |
'log' => '', | |
); | |
$oNodeRevision = (object) $aNodeRevision; | |
drupal_write_record('node_revisions', $oNodeRevision); | |
$aItem['item_id'] = $oNodeRevision->vid; | |
db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $oNodeRevision->nid, $oNodeRevision->vid); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment