Guest User

Untitled

a guest
Apr 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <?php
  2.  
  3. use DrupalComponentUtilityHtml;
  4. use DrupalnodeEntityNode;
  5.  
  6. function _update_node() {
  7.  
  8. // load nodes
  9. foreach($nids as $nid) {
  10. $node = Node::load($nid);
  11.  
  12. // do the work here
  13.  
  14. $node->save();
  15.  
  16. }
  17.  
  18. drush eval "module_load_include('inc', 'create_content', 'create_content'); _update_node();" > debug.txt
  19.  
  20. $node = Node::load($nid);
  21. $node->set('body', [
  22. 'summary' => 'the summary',
  23. 'value' => '<p>something</p>',
  24. 'format' => 'full_html', // probably
  25. ]);
  26. $node->save();
Add Comment
Please, Sign In to add comment