Problem/Motivation

Currently there is a fallback to ensure that in case you haven't configured a main content block, it is still renderend. This is quite problematic
as it destroys a lot how data flow works, and limits flexibility (you never know).

  if (is_string($page) || (is_array($page) && (!isset($page['#type']) || ($page['#type'] != 'page')))) {
    drupal_set_page_content($page);
    $page = element_info('page');
  }

  // Modules can add elements to $page as needed in hook_page_build().
  foreach (\Drupal::moduleHandler()->getImplementations('page_build') as $module) {
    $function = $module . '_page_build';
    $function($page);
  }

  // If no module has taken care of the main content, add it to the page now.
  // This allows the site to still be usable even if no modules that
  // control page regions (for example, the Block module) are enabled.
  if (!$main_content_display) {
    $page['content']['system_main'] = drupal_set_page_content();
  }

Proposed resolution

Ensure in the block configuration validation as well as in the UI that there is always a main content block. The same can be done by page manager.
On top of that render the main content block exactly the same as the other ones.

Remaining tasks

User interface changes

API changes

Comments

dawehner’s picture

Issue summary: View changes
wim leers’s picture

Status: Active » Closed (duplicate)