diff --git a/core/modules/book/book.admin.inc b/core/modules/book/book.admin.inc index 7d9e88b..014b899 100644 --- a/core/modules/book/book.admin.inc +++ b/core/modules/book/book.admin.inc @@ -104,7 +104,7 @@ function book_admin_edit_submit($form, &$form_state) { if ($row['parent']['plid']['#default_value'] != $values['parent']['plid'] || $row['weight']['#default_value'] != $values['weight']) { $menu_link = entity_load('menu_link', $values['parent']['mlid']); $menu_link->weight = $values['weight']; - $menu_link->plid = $values['plid']; + $menu_link->plid = $values['parent']['plid']; $menu_link->save(); $updated = TRUE; } diff --git a/core/modules/book/book.module b/core/modules/book/book.module index b7a3a18..09fdc3d 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -978,7 +978,8 @@ function book_preprocess_block(&$variables) { * * @param array $variables * An associative array containing the following key: - * - book_menus + * - book_menus: An associative array containing renderable menu links for all + * book menus. */ function template_preprocess_book_all_books_block(&$variables) { // Remove all non-renderable elements. @@ -996,7 +997,8 @@ function template_preprocess_book_all_books_block(&$variables) { * * @param array $variables * An associative array containing the following key: - * - book_link + * - book_link: An associative array of book link properties. + * Properties used: bid, link_title, depth, plid, mlid. */ function template_preprocess_book_navigation(&$variables) { drupal_add_css(drupal_get_path('module', 'book') . '/book.theme.css'); @@ -1117,10 +1119,10 @@ function book_toc($bid, $depth_limit, $exclude = array()) { * Default template: book-export-html.twig.html * * @param array $variables - * An associative array containing the following keys: - * - title - * - contents - * - depth + * An associative array containing: + * - title: The title of the book. + * - contents: Output of each book page. + * - depth: The max depth of the book. */ function template_preprocess_book_export_html(&$variables) { global $base_url; @@ -1202,14 +1204,15 @@ function book_node_export(EntityInterface $node, $children = '') { } /** - * Processes variables for single node export templates. + * Prepares variables for single node export templates. * * Default template: book-node-export-html.html.twig. * * @param array $variables * An associative array containing the following keys: - * - node - * - children + * - node: The node that will be output. + * - children: All the rendered child nodes within the current node. Defaults + * to an empty string. */ function template_preprocess_book_node_export_html(&$variables) { $variables['depth'] = $variables['node']->book['depth']; diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php index 4601342..ae44640 100644 --- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php +++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php @@ -501,12 +501,12 @@ public function testBookOrdering() { "table[book-admin-{$node1->nid}][weight]" => 1, "table[book-admin-{$node2->nid}][weight]" => 2, // Put node 2 under node 1. - "table[book-admin-{$node2->nid}][plid]" => $plid, + "table[book-admin-{$node2->nid}][parent][plid]" => $plid, ); $this->drupalPost(NULL, $edit, t('Save book pages')); // Verify weight was updated. $this->assertFieldByName("table[book-admin-{$node1->nid}][weight]", 1); $this->assertFieldByName("table[book-admin-{$node2->nid}][weight]", 2); - $this->assertFieldByName("table[book-admin-{$node2->nid}][plid]", $plid); + $this->assertFieldByName("table[book-admin-{$node2->nid}][parent][plid]", $plid); } } diff --git a/core/modules/book/templates/book-navigation.html.twig b/core/modules/book/templates/book-navigation.html.twig index 8c873f0..82e02fd 100644 --- a/core/modules/book/templates/book-navigation.html.twig +++ b/core/modules/book/templates/book-navigation.html.twig @@ -36,21 +36,21 @@