-
-
Save pazairfog/fa0f67a57c022461588540ffc82c8168 to your computer and use it in GitHub Desktop.
D7 fast clone node, menu item, scald context...
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
| fast clone |
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
| 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);' |
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
| drush ev '$node = node_load(NID); $node->nid = $node->vid = $node->created = NULL; $node->title = "[TEST] " . $node->title; node_save($node);' |
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
| 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