diff --git a/core/modules/book/book.install b/core/modules/book/book.install index 2293c46..7be7d8a 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 8e6fddf..aa6e3d8 100644 --- a/core/modules/forum/forum.install +++ b/core/modules/forum/forum.install @@ -14,11 +14,6 @@ function forum_install() { ->fields(array('weight' => 1)) ->condition('name', 'forum') ->execute(); - // 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 88495f4..b9299ee 100644 --- a/core/modules/node/content_types.inc +++ b/core/modules/node/content_types.inc @@ -175,7 +175,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 c5763e8..6aa0dd2 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -25,7 +25,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 5727129..8085cd6 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -601,6 +601,28 @@ function node_update_8004() { } /** + * 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_8005() { + // 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 27faf10..bc3225e 100644 --- a/core/profiles/standard/standard.install +++ b/core/profiles/standard/standard.install @@ -236,10 +236,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);