From 451bf657404cc1c2cbad1f8125fc4f3e0c5a9668 Mon Sep 17 00:00:00 2001
From: webchick <drupal@webchick.net>
Date: Sat, 3 Jan 2015 21:24:18 -0800
Subject: [PATCH] Issue #2401035 by alexpott: items_per_page in node.settings
 is no longer used

---
 .../migrate.migration.d6_node_settings.yml    |  2 --
 .../src/Tests/Dump/Drupal6NodeSettings.php    |  4 ---
 .../src/Tests/d6/MigrateNodeConfigsTest.php   |  1 -
 .../node/config/install/node.settings.yml     |  1 -
 .../node/config/schema/node.schema.yml        |  3 --
 core/modules/node/node.module                 | 33 -------------------
 6 files changed, 44 deletions(-)

diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml
index 487a4c42023a..83c6386b3ce1 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml
@@ -6,10 +6,8 @@ source:
   plugin: variable
   variables:
     - node_admin_theme
-    - default_nodes_main
 process:
   use_admin_theme: node_admin_theme
-  items_per_page: default_nodes_main
 destination:
   plugin: config
   config_name: node.settings
diff --git a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6NodeSettings.php b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6NodeSettings.php
index eb4353e4108e..4fb67b9e5e79 100644
--- a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6NodeSettings.php
+++ b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6NodeSettings.php
@@ -25,10 +25,6 @@ public function load() {
       'name' => 'node_admin_theme',
       'value' => 'i:0;',
     ))
-    ->values(array(
-      'name' => 'default_nodes_main',
-      'value' => 's:1:"3";',
-    ))
     ->execute();
   }
 }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
index 65960dc64165..d68e00e180cf 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
@@ -48,7 +48,6 @@ protected function setUp() {
   public function testNodeSettings() {
     $config = $this->config('node.settings');
     $this->assertIdentical($config->get('use_admin_theme'), FALSE);
-    $this->assertIdentical($config->get('items_per_page'), 3);
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'node.settings', $config->get());
   }
 
diff --git a/core/modules/node/config/install/node.settings.yml b/core/modules/node/config/install/node.settings.yml
index 549c96e2fc8c..5224eef2a5a0 100644
--- a/core/modules/node/config/install/node.settings.yml
+++ b/core/modules/node/config/install/node.settings.yml
@@ -1,2 +1 @@
-items_per_page: 10
 use_admin_theme: false
diff --git a/core/modules/node/config/schema/node.schema.yml b/core/modules/node/config/schema/node.schema.yml
index 0680b5706b89..f650794ccdf2 100644
--- a/core/modules/node/config/schema/node.schema.yml
+++ b/core/modules/node/config/schema/node.schema.yml
@@ -4,9 +4,6 @@ node.settings:
   type: mapping
   label: 'Node settings'
   mapping:
-    items_per_page:
-      type: integer
-      label: 'Number of posts on front page'
     use_admin_theme:
       type: boolean
       label: 'Use admin theme when editing or creating content'
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 688b797f7686..3a75398a5c6a 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -830,39 +830,6 @@ function node_page_top(array &$page) {
   }
 }
 
-/**
- * Implements hook_form_FORM_ID_alter().
- *
- * Alters the System module's site information settings form to add a global
- * default setting for number of posts to show on node listing pages.
- *
- * @see node_page_default()
- * @see node_form_system_site_information_settings_form_submit()
- */
-function node_form_system_site_information_settings_form_alter(&$form, FormStateInterface $form_state, $form_id) {
-  $options = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30);
-  $form['front_page']['default_nodes_main'] = array(
-    '#type' => 'select',
-    '#title' => t('Number of posts on front page'),
-    '#default_value' => \Drupal::config('node.settings')->get('items_per_page'),
-    '#options' => array_combine($options, $options),
-    '#access' => (\Drupal::config('system.site')->get('page.front') == 'node'),
-    '#description' => t('The maximum number of posts displayed on overview pages such as the front page.'),
-  );
-  $form['#submit'][] = 'node_form_system_site_information_settings_form_submit';
-}
-
-/**
- * Form submission handler for system_site_information_settings().
- *
- * @see node_form_system_site_information_settings_form_alter()
- */
-function node_form_system_site_information_settings_form_submit($form, FormStateInterface $form_state) {
-  \Drupal::config('node.settings')
-    ->set('items_per_page', $form_state->getValue('default_nodes_main'))
-    ->save();
-}
-
 /**
  * Implements hook_form_FORM_ID_alter().
  *
-- 
GitLab