MDL-66477 core: only render region main settings if no settings block

We added a change to allow the region main settings menu to be
rendered in the header rather that the top of the body however
this also meant that the settings were shown on themes (e.g. Classic)
that didn't otherwise show the region main settings.

The simplest solution seems to be to not render the region main
settings in the header if the settings block is on the page.
This commit is contained in:
Ryan Wyllie 2019-10-04 10:31:06 +08:00 committed by Adrian Greeve
parent e5277f0a7f
commit f9d76e4905

View File

@ -4263,7 +4263,10 @@ EOD;
public function full_header() {
global $PAGE;
if ($PAGE->include_region_main_settings_in_header_actions()) {
if ($PAGE->include_region_main_settings_in_header_actions() && !$PAGE->blocks->is_block_present('settings')) {
// Only include the region main settings if the page has requested it and it doesn't already have
// the settings block on it. The region main settings are included in the settings block and
// duplicating the content causes behat failures.
$PAGE->add_header_action(html_writer::div(
$this->region_main_settings_menu(),
'd-print-none',