diff --git a/core/modules/book/book.module b/core/modules/book/book.module index 39aee79..3462abf 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -1242,7 +1242,6 @@ function book_node_type_update(NodeTypeInterface $type) { $allowed_types[$old_key] = $type->id(); // Ensure that the allowed_types array is sorted consistently. // @see BookSettingsForm::submitForm() - // @todo Drop sorting https://drupal.org/node/2026159 sort($allowed_types); $config->set('allowed_types', $allowed_types); } diff --git a/core/modules/book/lib/Drupal/book/BookSettingsForm.php b/core/modules/book/lib/Drupal/book/BookSettingsForm.php index a0bfeac..3de9899 100644 --- a/core/modules/book/lib/Drupal/book/BookSettingsForm.php +++ b/core/modules/book/lib/Drupal/book/BookSettingsForm.php @@ -67,7 +67,6 @@ public function submitForm(array &$form, array &$form_state) { // We need to save the allowed types in an array ordered by machine_name so // that we can save them in the correct order if node type changes. // @see book_node_type_update(). - // @todo Drop sorting https://drupal.org/node/2026159 sort($allowed_types); $this->configFactory->get('book.settings') // Remove unchecked types. diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index 5865920..844b35a 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -36,7 +36,7 @@ protected function prepareEntity() { $node = $this->entity; // Set up default values, if required. $type = entity_load('node_type', $node->bundle()); - $this->settings = $type->getNodeSettings('node'); + $this->settings = $type->getModuleSettings('node'); $this->settings += array( 'options' => array('status', 'promote'), 'preview' => DRUPAL_OPTIONAL, diff --git a/core/modules/node/lib/Drupal/node/NodeTypeFormController.php b/core/modules/node/lib/Drupal/node/NodeTypeFormController.php index 9bb4f11..032e2a9 100644 --- a/core/modules/node/lib/Drupal/node/NodeTypeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeTypeFormController.php @@ -61,7 +61,7 @@ public function form(array $form, array &$form_state) { drupal_set_title(t('Edit %label content type', array('%label' => $type->label())), PASS_THROUGH); } - $node_settings = $type->getNodeSettings('node'); + $node_settings = $type->getModuleSettings('node'); // Ensure default settings. $node_settings += array( 'options' => array('status', 'promote'), diff --git a/core/modules/node/lib/Drupal/node/NodeTypeInterface.php b/core/modules/node/lib/Drupal/node/NodeTypeInterface.php index 4ec2ec7..b0f7579 100644 --- a/core/modules/node/lib/Drupal/node/NodeTypeInterface.php +++ b/core/modules/node/lib/Drupal/node/NodeTypeInterface.php @@ -15,16 +15,16 @@ interface NodeTypeInterface extends ConfigEntityInterface { /** - * Returns the configured Node settings of a given module, if any. + * Returns the configured node type settings of a given module, if any. * * @param string $module * The name of the module whose settings to return. * * @return array - * An associative array containing the module's Node settings. Note that - * this can be empty, and default values do not necessarily exist. + * An associative array containing the module's settings for the node type. + * Note that this can be empty, and default values do not necessarily exist. */ - public function getNodeSettings($module); + public function getModuleSettings($module); /** * Returns a locked state of the type. diff --git a/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/NodeType.php b/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/NodeType.php index 6491711..afc11f4 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/NodeType.php +++ b/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/NodeType.php @@ -151,7 +151,7 @@ public function uri() { /** * {@inheritdoc} */ - public function getNodeSettings($module) { + public function getModuleSettings($module) { if (isset($this->settings[$module]) && is_array($this->settings[$module])) { return $this->settings[$module]; } diff --git a/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php b/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php index 191d45c..b485545 100644 --- a/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php @@ -179,8 +179,6 @@ function testPagePreview() { /** * Checks the node preview functionality, when using revisions. - * - * @todo This test passes even with revisioning disabled. */ function testPagePreviewWithRevisions() { $langcode = Language::LANGCODE_NOT_SPECIFIED; @@ -188,7 +186,7 @@ function testPagePreviewWithRevisions() { $body_key = "body[$langcode][0][value]"; $term_key = "{$this->field_name}[$langcode]"; // Force revision on "Basic page" content. - config('node.type.page')->set('settings.node.options', array('status', 'revision'))->save(); + $this->container->get('config.factory')->get('node.type.page')->set('settings.node.options', array('status', 'revision'))->save(); // Fill in node creation form and preview node. $edit = array(); diff --git a/core/modules/node/node.install b/core/modules/node/node.install index c7c23cb..1ad54e8 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -1105,8 +1105,9 @@ function node_update_8020() { update_variable_del($name); } $config->save(); - // Convert 'base' property to state. - if ($node_type['base'] !== 'node_content' && Drupal::moduleHandler()->moduleExists($node_type['base'])) { + // Convert 'base' property to state. Note than module could be disabled at + // this time so just preserving the relation. + if ($node_type['base'] !== 'node_content') { $locked[$id] = $node_type['base']; } } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 15b93f9..a35ad88 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1287,7 +1287,7 @@ function node_menu() { ); $items['admin/structure/types/manage/%node_type'] = array( 'title' => 'Edit content type', - 'title callback' => 'node_type_page_title', + 'title callback' => 'entity_page_label', 'title arguments' => array(4), 'route_name' => 'node_type_edit', ); @@ -1400,22 +1400,6 @@ function node_menu_local_tasks(&$data, $router_item, $root_path) { } /** - * Title callback: Provides the title for a node type edit form. - * - * @param string $type_name - * The machine name of the node type. - * - * @return string - * An unsanitized string that is the title of the node type edit form. - * - * @see node_menu() - */ -function node_type_page_title($type_name) { - $type = entity_load('node_type', $type_name); - return $type->label(); -} - -/** * Title callback: Displays the node's title. * * @param \Drupal\Core\Entity\EntityInterface $node @@ -2287,7 +2271,7 @@ function node_list_permissions($type) { function node_permissions_get_configured_types() { $configured_types = array(); foreach (node_type_get_types() as $name => $type) { - $node_settings = $type->getNodeSettings('node'); + $node_settings = $type->getModuleSettings('node'); if (!isset($node_settings['permissions']) || !empty($node_settings['permissions'])) { $configured_types[$name] = $type; }