diff options
Diffstat (limited to 'modules/node/node.install')
-rw-r--r-- | modules/node/node.install | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/node/node.install b/modules/node/node.install index aa278adba..e2f8ec8d9 100644 --- a/modules/node/node.install +++ b/modules/node/node.install @@ -407,6 +407,27 @@ function node_update_7003() { } /** + * Extend the existing default preview and teaser settings to all node types. + */ +function node_update_7004() { + // Get original settings and all types. + $original_length = variable_get('teaser_length', 600); + $original_preview = variable_get('node_preview', 0); + + // Map old preview setting to new values order. + $original_preview ? $original_preview = 2 : $original_preview = 1; + $type_list = node_get_types('types'); + + // Apply original settings to all types. + foreach ($type_list as $type) { + variable_set('teaser_length_' . $type, $original_length); + variable_set('node_preview_' . $type, $original_preview); + } + // Delete old variable but leave 'teaser_length' for aggregator module upgrade. + variable_del('node_preview'); +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ |