diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index 064250f3e483baedb7f479311e3ca25a6f0f3664..52ac7d54389b5fc81654babd1002577a9e40cb21 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -64,7 +64,7 @@ public function getBaseFormID() { // twice otherwise. $base_form_id = $this->entity->entityType() . '_form'; if ($base_form_id == $this->getFormId()) { - $base_form_id = ''; + $base_form_id = NULL; } return $base_form_id; } diff --git a/core/lib/Drupal/Core/Form/BaseFormIdInterface.php b/core/lib/Drupal/Core/Form/BaseFormIdInterface.php index f948aac7b1cfa6878188000ed2b91fcdb94dbb47..3576758e84d3be6f4561e917b21287a47ecea409 100644 --- a/core/lib/Drupal/Core/Form/BaseFormIdInterface.php +++ b/core/lib/Drupal/Core/Form/BaseFormIdInterface.php @@ -18,8 +18,8 @@ interface BaseFormIdInterface extends FormInterface { /** * Returns a string identifying the base form. * - * @return string|false - * The string identifying the base form or FALSE if this is not a base form. + * @return string|null + * The string identifying the base form or NULL if this is not a base form. */ public function getBaseFormID(); diff --git a/core/modules/book/lib/Drupal/book/Form/BookOutlineForm.php b/core/modules/book/lib/Drupal/book/Form/BookOutlineForm.php index d0960f434a6c2192ec5f8af06446afaaef24aa2c..94d9b8a2806a5e963c97f8cb38e34932c79d617f 100644 --- a/core/modules/book/lib/Drupal/book/Form/BookOutlineForm.php +++ b/core/modules/book/lib/Drupal/book/Form/BookOutlineForm.php @@ -7,14 +7,14 @@ namespace Drupal\book\Form; -use Drupal\Core\Entity\EntityFormControllerNG; +use Drupal\Core\Entity\ContentEntityFormController; use Drupal\book\BookManager; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Displays the book outline form. */ -class BookOutlineForm extends EntityFormControllerNG { +class BookOutlineForm extends ContentEntityFormController { /** * The book being displayed. @@ -51,7 +51,7 @@ public static function create(ContainerInterface $container) { * {@inheritdoc} */ public function getBaseFormID() { - return FALSE; + return NULL; } /** diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php index 4772dface5515b8cd3e6c94ea698c67a2c24acfa..5ea8b8d4bc44881673404c3986827021e0b981a0 100644 --- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php +++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php @@ -509,4 +509,17 @@ public function testBookOrdering() { $this->assertFieldByName("table[book-admin-{$node2->id()}][weight]", 2); $this->assertFieldByName("table[book-admin-{$node2->id()}][plid]", $plid); } + + /** + * Tests outline of a book. + */ + public function testBookOutline() { + // Create new book. + $this->drupalLogin($this->book_author); + $book = $this->createBookNode('new'); + + $this->drupalLogin($this->admin_user); + $this->drupalGet('node/' . $book->id() . '/outline'); + $this->assertRaw(t('Book outline')); + } }