From f9d76e490564bbaf0c206e4f6076b235159300a5 Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Fri, 4 Oct 2019 10:31:06 +0800 Subject: [PATCH] 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. --- lib/outputrenderers.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index e457330fd39..e0570e428d2 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -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',