Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use DrupalComponentUtilityHtml;
- use DrupalnodeEntityNode;
- function _update_node() {
- // load nodes
- foreach($nids as $nid) {
- $node = Node::load($nid);
- // do the work here
- $node->save();
- }
- drush eval "module_load_include('inc', 'create_content', 'create_content'); _update_node();" > debug.txt
- $node = Node::load($nid);
- $node->set('body', [
- 'summary' => 'the summary',
- 'value' => '<p>something</p>',
- 'format' => 'full_html', // probably
- ]);
- $node->save();
Add Comment
Please, Sign In to add comment