This object doesn't override an existing node with node_save()

  1. <?php
  2.  
  3. $node = somefunction();
  4. dprint_r($node);
  5. node_save($node); // This doesn't update the existing node
  6.  
  7. /*
  8. This is a dprint_r($node) results:
  9.  
  10. stdClass Object
  11. (
  12.     [type] => library_items
  13.     [title] => The biographical dictionary of women in science :   pioneering lives from ancient times to the mid-20th century
  14.     [status] => 1
  15.     [comment] => 0
  16.     [promote] => 1
  17.     [moderate] => 0
  18.     [format] => 2
  19.     [uid] => 1
  20.     [name] => admin
  21.     [log] => Imported automatically by Millennium module on date 5:21:19 pm
  22.     [teaser] =>
  23.     [body] => HOLA HOLA HOLA!
  24.     [millennium_biblio_data] => Array
  25.         (
  26.             [lcc] => Q141 .B5285 2000
  27.             [notes] => Includes bibliographical references and indexes<br />
  28. v. 1. A-K -- v. 2. L-Z<br
  29.             [links] =>
  30.             [item_description] =>
  31.             [type_num] => 100
  32.             [type] => Book
  33.             [title] => The biographical dictionary of women in science :   pioneering lives from ancient times to the mid-20th century
  34.             [short_title] =>
  35.             [alternate_title] => Women in science
  36.             [translated_title] =>
  37.             [authors] => Ogilvie, Marilyn Bailey; Harvey, Joy Dorothy
  38.             [corp_author] =>
  39.             [edition] =>
  40.             [isbn] => 0415920388; 0415920396; 041592040X
  41.             [issn] =>
  42.             [series] =>
  43.             [imprint_place] => New York
  44.             [imprint_name] => Routledge
  45.             [imprint_date] => 2000
  46.             [lang] => English
  47.             [item_recnum] => i4673612
  48.             [imprint] => Routledge, New York : 2000
  49.             [url] => http://www.consuls.org/record=i4673612&searchscope=0
  50.         )
  51.  
  52.     [taxonomy] => Array
  53.         (
  54.             [tags] => Array
  55.                 (
  56.                     [11] => Book,Biography,Dictionaries
  57.                     [10] => Women scientists
  58.                 )
  59.  
  60.         )
  61.  
  62.     [nid] => 1197
  63.     [created] => 1227136879
  64.     [validated] => 1
  65.     [is_new] =>
  66.     [changed] => 1227136879
  67.     [timestamp] => 1227136879
  68. )
  69. */
  70. ?>

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockcode>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • Lines and paragraphs break automatically.

More information about formatting options