diff --git a/core/modules/book/book.install b/core/modules/book/book.install index 797902a..7bc3f6d 100644 --- a/core/modules/book/book.install +++ b/core/modules/book/book.install @@ -42,8 +42,6 @@ function _book_install_type_create() { $book_node_type = node_type_set_defaults($book_node_type); node_type_save($book_node_type); node_add_body_field($book_node_type); - // Default to not promoted. - variable_set('node_options_book', array('status')); } /** diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install index b1e63de..c618382 100644 --- a/core/modules/forum/forum.install +++ b/core/modules/forum/forum.install @@ -11,11 +11,6 @@ function forum_install() { // Set the weight of the forum.module to 1 so it is loaded after the taxonomy.module. module_set_weight('forum', 1); - // Forum topics are published by default, but do not have any other default - // options set (for example, they are not promoted to the front page). - // @todo Convert to default module configuration, once Node module's content - // types are converted. - variable_set('node_options_forum', array('status')); } /** diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc index c958f27..6bbe3ff 100644 --- a/core/modules/node/content_types.inc +++ b/core/modules/node/content_types.inc @@ -199,7 +199,7 @@ function node_type_form($form, &$form_state, $type = NULL) { ); $form['workflow']['node_options'] = array('#type' => 'checkboxes', '#title' => t('Default options'), - '#default_value' => variable_get('node_options_' . $type->type, array('status', 'promote')), + '#default_value' => variable_get('node_options_' . $type->type, array('status')), '#options' => array( 'status' => t('Published'), 'promote' => t('Promoted to front page'), diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index a7354ee..c7fe381 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -27,7 +27,7 @@ class NodeFormController extends EntityFormController { */ protected function prepareEntity(EntityInterface $node) { // Set up default values, if required. - $node_options = variable_get('node_options_' . $node->type, array('status', 'promote')); + $node_options = variable_get('node_options_' . $node->type, array('status')); // If this is a new node, fill in the default values. if (!isset($node->nid) || isset($node->is_new)) { foreach (array('status', 'promote', 'sticky') as $key) { diff --git a/core/modules/node/node.install b/core/modules/node/node.install index 12a6945..2679bb5 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -707,6 +707,28 @@ function node_update_8013() { } /** + * Change default promoted flag of node types to enabled. + * + * The default for 'Promoted to front page' was changed from enabled to + * disabled. Since enabled was the implicit default previously, and may not have + * been explicitly configured as such, this update ensures that the old implicit + * default is still the default. + */ +function node_update_8014() { + // Fetch the available node types. + $types = db_query('SELECT type FROM {node_type}')->fetchCol(); + + foreach ($types as $type) { + $options = variable_get("node_options_$type"); + if (!isset($options)) { + $options['promote'] = 'promote'; + $options['status'] = 'status'; + variable_set("node_options_$type", $options); + } + } +} + +/** * @} End of "addtogroup updates-7.x-to-8.x" * The next series of updates should start at 9000. */ diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install index 8802bbc..b6ec2fa 100644 --- a/core/profiles/standard/standard.install +++ b/core/profiles/standard/standard.install @@ -80,10 +80,12 @@ function standard_install() { rdf_mapping_save($rdf_mapping); } - // Default "Basic page" to not be promoted and have comments disabled. - variable_set('node_options_page', array('status')); + // Default "Basic page" to have comments disabled. variable_set('comment_page', COMMENT_NODE_HIDDEN); + // Default "Article" to be promoted. + variable_set('node_options_article', array('status', 'promote')); + // Don't display date and author information for "Basic page" nodes by default. variable_set('node_submitted_page', FALSE);