Skip to content

Instantly share code, notes, and snippets.

@pazairfog
Last active October 31, 2017 11:18
Show Gist options
  • Select an option

  • Save pazairfog/fa0f67a57c022461588540ffc82c8168 to your computer and use it in GitHub Desktop.

Select an option

Save pazairfog/fa0f67a57c022461588540ffc82c8168 to your computer and use it in GitHub Desktop.
D7 fast clone node, menu item, scald context...
drush ev '$entity = entity_load_single(ECK_ENTITY_TYPE, ID); $entity->id = $entity->created = NULL; $entity->title = "[TEST] " . $entity->title; entity_save(ECK_ENTITY_TYPE, $entity);'
drush ev '$node = node_load(NID); $node->nid = $node->vid = $node->created = NULL; $node->title = "[TEST] " . $node->title; node_save($node);'
foreach ($titles as $title) {
$context = [
'name' => drupal_html_class($title),
'title' => $title,
'description' => '',
'render_language' => 'XHTML',
'parseable' => TRUE,
'formats' => [],
];
scald_context_save($context);
}
cache_clear_all('*', 'cache_scald', TRUE);
cache_clear_all('field_info_types', 'cache_field', TRUE);
field_info_cache_clear();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment