summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-14 01:01:54 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-14 01:01:54 +0000
commitb6164a4cb7db9cd61caceaea2c36a377ffe7f94d (patch)
treea027985b642b504ed544dcd7df75721689854e22
parent04d0ef5c8ce2646aeb3879f656e34a3836110ff2 (diff)
downloadbrdo-b6164a4cb7db9cd61caceaea2c36a377ffe7f94d.tar.gz
brdo-b6164a4cb7db9cd61caceaea2c36a377ffe7f94d.tar.bz2
- Patch #586436 by Amitaibu: execute node_type_save() after variable_set().
-rw-r--r--modules/node/content_types.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index 4634d62e5..a0e0d0607 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -37,7 +37,7 @@ function node_overview_types() {
if (empty($rows)) {
$rows[] = array(array('data' => t('No content types available. <a href="@link">Add content type</a>.', array('@link' => url('admin/structure/types/add'))), 'colspan' => '5', 'class' => array('message')));
}
-
+
$build['node_table'] = array(
'#theme' => 'table',
'#header' => $header,
@@ -199,7 +199,7 @@ function node_type_form($form, &$form_state, $type = NULL) {
'#description' => t('Enable the <em>submitted by Username on date</em> text.'),
);
$form['display']['teaser_length'] = array(
- '#type' => 'select',
+ '#type' => 'select',
'#title' => t('Length of trimmed posts'),
'#default_value' => variable_get('teaser_length_' . $type->type, 600),
'#options' => drupal_map_assoc(array(0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000), '_node_characters'),
@@ -323,8 +323,6 @@ function node_type_form_submit($form, &$form_state) {
return;
}
- $status = node_type_save($type);
-
$variables = $form_state['values'];
// Remove everything that's been saved already - whatever's left is assumed
@@ -352,6 +350,10 @@ function node_type_form_submit($form, &$form_state) {
}
}
+ // Saving the content type after saving the variables allows modules to act
+ // on those variables via hook_node_type_insert().
+ $status = node_type_save($type);
+
node_types_rebuild();
menu_rebuild();
$t_args = array('%name' => $type->name);