diff --git a/core/modules/book/book.admin.inc b/core/modules/book/book.admin.inc
index d6d369e..2c80cd8 100644
--- a/core/modules/book/book.admin.inc
+++ b/core/modules/book/book.admin.inc
@@ -92,9 +92,14 @@ function book_admin_settings_validate($form, &$form_state) {
  * @see book_admin_settings_validate()
  */
 function book_admin_settings_submit($form, &$form_state) {
+  // Remove unchecked types.
+  $allowed_types = array_filter($form_state['values']['book_allowed_types']);
+  // Ensure that allowed types are ordered consistently even if the
+  // machine-readable name of the node type changes.
+  // @see book_node_type_update().
+  sort($allowed_types);
   config('book.settings')
-    // Remove unchecked types.
-    ->set('allowed_types', array_filter($form_state['values']['book_allowed_types']))
+    ->set('allowed_types', $allowed_types)
     ->set('child_type', $form_state['values']['book_child_type'])
     ->save();
  }
diff --git a/core/modules/book/book.install b/core/modules/book/book.install
index 700421e..7d70a02 100644
--- a/core/modules/book/book.install
+++ b/core/modules/book/book.install
@@ -99,18 +99,12 @@ function book_update_8000() {
   ));
   $allowed_types = update_variable_get('book_allowed_types', FALSE);
   if ($allowed_types) {
-    // In Drupal 7 the variable book_allowed_types was stored like this:
-    // array(
-    //   0 => 'book',
-    //   1 => 'article',
-    // )
-    // In Drupal 8 book.settings:allowed_types should be stored like this:
-    // array(
-    //   'book' => 'book',
-    //   'article' => 'article',
-    // )
+    // Ensure consistent ordering of allowed_types.
+    // @see book_admin_settings_submit()
+    sort($allowed_types);
+
     config('book.settings')
-      ->set('allowed_types', drupal_map_assoc($allowed_types))
+      ->set('allowed_types', $allowed_types)
       ->save();
   }
 
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index 81b0c99..3d0340d 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -1232,27 +1232,28 @@ function template_preprocess_book_node_export_html(&$variables) {
  *   A Boolean TRUE if the node type can be included in books; otherwise, FALSE.
  */
 function book_type_is_allowed($type) {
-  $allowed_types = config('book.settings')->get('allowed_types');
-  return isset($allowed_types[$type]);
+  return in_array($type, config('book.settings')->get('allowed_types'));
 }
 
 /**
  * Implements hook_node_type_update().
  *
- * Updates the Book module's persistent variables if the machine-readable name
- * of a node type is changed.
+ * Updates book.settings configuration object if the machine-readable name of a
+ * node type is changed.
  */
 function book_node_type_update($type) {
   if (!empty($type->old_type) && $type->old_type != $type->type) {
     $config = config('book.settings');
     // Update the list of node types that are allowed to be added to books.
     $allowed_types = $config->get('allowed_types');
-
-    if (isset($allowed_types[$type->old_type])) {
+    $old_key = array_search($type->old_type, $allowed_types);
+    if ($old_key !== FALSE) {
       // Replace the old machine-readable name with the new machine-readable
       // name.
-      $allowed_types[$type->type] = $type->type;
-      unset($allowed_types[$type->old_type]);
+      $allowed_types[$old_key] = $type->type;
+      // Ensure that the allowed type array is sorted consistently.
+      // @see book_admin_settings_submit()
+      sort($allowed_types);
       $config->set('allowed_types', $allowed_types);
     }
 
diff --git a/core/modules/book/config/book.settings.yml b/core/modules/book/config/book.settings.yml
index 6a57d5d..fb18d6d 100644
--- a/core/modules/book/config/book.settings.yml
+++ b/core/modules/book/config/book.settings.yml
@@ -1,5 +1,5 @@
 allowed_types:
-  book: book
+  - book
 block:
   navigation:
     mode: 'all pages'
diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
index 4798cee..f95d463 100644
--- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php
+++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
@@ -67,7 +67,7 @@ function setUp() {
     // Create users.
     $this->book_author = $this->drupalCreateUser(array('create new books', 'create book content', 'edit own book content', 'add content to books'));
     $this->web_user = $this->drupalCreateUser(array('access printer-friendly version', 'node test view'));
-    $this->admin_user = $this->drupalCreateUser(array('create new books', 'create book content', 'edit own book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'node test view', 'administer content types'));
+    $this->admin_user = $this->drupalCreateUser(array('create new books', 'create book content', 'edit own book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'node test view', 'administer content types', 'administer site configuration'));
   }
 
   /**
@@ -405,6 +405,81 @@ function testBookNodeTypeChange() {
     // the new machine and the old one has been removed.
     $this->assertTrue(book_type_is_allowed('bar'), 'Config book.settings:allowed_types contains the updated node type machine name "bar".');
     $this->assertFalse(book_type_is_allowed('book'), 'Config book.settings:allowed_types does not contain the old node type machine name "book".');
+
+    $edit = array(
+      'name' => 'Basic page',
+      'title_label' => 'Title for basic page',
+      'type' => 'page',
+    );
+    $this->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
+
+    // Add page to the allowed node types.
+    $edit = array(
+      'book_allowed_types[page]' => 'page',
+      'book_allowed_types[bar]' => 'bar',
+    );
+
+    $this->drupalPost('admin/content/book/settings', $edit, t('Save configuration'));
+    $this->assertTrue(book_type_is_allowed('bar'), 'Config book.settings:allowed_types contains the bar node type.');
+    $this->assertTrue(book_type_is_allowed('page'), 'Config book.settings:allowed_types contains the page node type.');
+
+    // Test the order of the book.settings::allowed_types configuration is as
+    // expected. The point of this test is to prove that after changing a node
+    // type going to admin/content/book/settings and pressing save without
+    // changing anything should not alter the book.settings configuration. The
+    // order will be:
+    // @code
+    // array(
+    //   'bar',
+    //   'page',
+    // );
+    // @endcode
+    $current_config = config('book.settings')->init()->get();
+    $this->drupalPost('admin/content/book/settings', array(), t('Save configuration'));
+    $this->assertIdentical($current_config, config('book.settings')->init()->get());
+
+    // Change the name, machine name and description.
+    $edit = array(
+      'name' => 'Zebra book',
+      'type' => 'zebra',
+    );
+    $this->drupalPost('admin/structure/types/manage/bar', $edit, t('Save content type'));
+    $this->assertTrue(book_type_is_allowed('zebra'), 'Config book.settings:allowed_types contains the zebra node type.');
+    $this->assertTrue(book_type_is_allowed('page'), 'Config book.settings:allowed_types contains the page node type.');
+
+    // Test the order of the book.settings::allowed_types configuration is as
+    // expected. The order should be:
+    // @code
+    // array(
+    //   'page',
+    //   'zebra',
+    // );
+    // @endcode
+    $current_config = config('book.settings')->init()->get();
+    $this->drupalPost('admin/content/book/settings', array(), t('Save configuration'));
+    $this->assertIdentical($current_config, config('book.settings')->init()->get());
+
+    $edit = array(
+      'name' => 'Animal book',
+      'type' => 'zebra',
+    );
+    $this->drupalPost('admin/structure/types/manage/zebra', $edit, t('Save content type'));
+
+    // Test the order of the book.settings::allowed_types configuration is as
+    // expected. The order should be:
+    // @code
+    // array(
+    //   'page',
+    //   'zebra',
+    // );
+    // @endcode
+    $current_config = config('book.settings')->init()->get();
+    $this->drupalPost('admin/content/book/settings', array(), t('Save configuration'));
+    $this->assertIdentical($current_config, config('book.settings')->init()->get());
+
+    // Ensure that after all the node type changes book.settings:child_type has
+    // the expected value.
+    $this->assertEqual(config('book.settings')->get('child_type'), 'zebra');
   }
 }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
index 73a2977..4194f9f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
@@ -141,9 +141,9 @@ public function testVariableUpgrade() {
 
     $expected_config['book.settings'] = array(
       'allowed_types' => array(
-        'book' => 'book',
+        'book',
         // Content type does not have to exist.
-        'test' => 'test',
+        'test',
       ),
       'block' => array(
         'navigation' => array(
diff --git a/core/modules/system/tests/upgrade/drupal-7.system.database.php b/core/modules/system/tests/upgrade/drupal-7.system.database.php
index be9f54c..a27ca3b 100644
--- a/core/modules/system/tests/upgrade/drupal-7.system.database.php
+++ b/core/modules/system/tests/upgrade/drupal-7.system.database.php
@@ -134,7 +134,7 @@
   ->condition('name', 'filter_fallback_format')
   ->execute();
 db_update('variable')
-  ->fields(array('value' => 'a:2:{i:0;s:4:"book";i:1;s:4:"test";}'))
+  ->fields(array('value' => 'a:2:{i:0;s:4:"test";i:1;s:4:"book";}'))
   ->condition('name', 'book_allowed_types')
   ->execute();
 
