Problem/Motivation

When creating a page with a "Full Page Variant" I get the following fatal error:

Recoverable fatal error: Argument 1 passed to Drupal\system\Plugin\Block\SystemMainBlock::setMainContent() must be of the type array, null given, called in core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php on line 111 and defined in Drupal\system\Plugin\Block\SystemMainBlock->setMainContent() (line 34 of core/modules/system/src/Plugin/Block/SystemMainBlock.php).

Drupal\system\Plugin\Block\SystemMainBlock->setMainContent(NULL)
Drupal\block\Plugin\DisplayVariant\FullPageVariant->build()
Drupal\page_manager\Entity\PageViewBuilder->view(Object, 'full', NULL)
Drupal\Core\Entity\Controller\EntityViewController->view(Object, 'full', NULL)
call_user_func_array(Array, Array)
Drupal\Core\Controller\HtmlPageController->getContentResult(Object, '\Drupal\Core\Entity\Controller\EntityViewController::view')
Drupal\Core\Controller\HtmlPageController->content(Object, '\Drupal\Core\Entity\Controller\EntityViewController::view')
call_user_func_array(Array, Array)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)

The code was introduced in: https://www.drupal.org/node/2363025

Steps to Reproduce

  1. Go to http://localhost/d8/admin/structure/page_manager and add a new page with any path
  2. Add new display variant of type "Full Page".
  3. Visit page and see fatal error.

Proposed resolution

?

Remaining tasks

Find out what the actual problem is.

User interface changes

n/a

API changes

n/a

Comments

tim.plunkett’s picture

Title: Argument 1 passed to SystemMainBlock::setMainContent() must be of type array » FullPageVariant::$mainContent must always be an array
Project: Page Manager » Drupal core
Version: 8.x-1.x-dev » 8.0.x-dev
Component: Code » block.module
Priority: Normal » Major
Status: Active » Needs review
Issue tags: +Page Manager
StatusFileSize
new917 bytes
new1.44 KB

Nice find. This is easily reproduced in page_manager, but is actually a core bug.

tim.plunkett’s picture

StatusFileSize
new1.55 KB

Now with a docblock on the test.

benjy’s picture

Status: Needs review » Reviewed & tested by the community

Easy fix, thanks.

The last submitted patch, 1: 2371841-fullpage-1-FAIL.patch, failed testing.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 57b2e4f and pushed to 8.0.x. Thanks!

  • alexpott committed 57b2e4f on 8.0.x
    Issue #2371841 by tim.plunkett | benjy: Fixed FullPageVariant::$...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.