From efec539e217868ae0a233941605e92f61314e1eb Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:48:52 +0100 Subject: [PATCH] Fix for combined headings --- public/class-bread-meetingslist-structure.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/class-bread-meetingslist-structure.php b/public/class-bread-meetingslist-structure.php index f236700..7af0fed 100644 --- a/public/class-bread-meetingslist-structure.php +++ b/public/class-bread-meetingslist-structure.php @@ -134,6 +134,9 @@ private function upgradeHeaderData(string $meeting_sort) } else { $this->options['main_grouping'] = 'day'; } + if (!empty($this->options['subgrouping']) && $this->options['sub_header_shown'] == 'combined') { + $this->options['combine_headings'] = 'main_grouping - subgrouping'; + } } /** * Setup for structuring the meeting list @@ -435,7 +438,7 @@ public function calculateHeading(): string } $this_heading = $this->remove_sort_key($this->main_heading_raw); $this_subheading = $this->remove_sort_key($this->sub_heading_raw); - if (($this->meeting_index == 1) && !empty($options['combine_headings'])) { + if (($this->meeting_index == 1) && !empty($this->options['combine_headings'])) { $header_string = $this->options['combine_headings']; $header_string = str_replace('main_grouping', $this_heading, $header_string); $header_string = str_replace('subgrouping', $this_subheading, $header_string); @@ -477,8 +480,9 @@ public function calculateContHeader(): string } $header_string = $this->options['combine_headings']; $header_string = str_replace('main_grouping', $this->remove_sort_key($this->main_heading_raw), $header_string); - $header_string = str_replace('subgrouping', $this->remove_sort_key($this->main_heading_raw), $header_string); + $header_string = str_replace('subgrouping', $this->remove_sort_key($this->sub_heading_raw), $header_string); $header .= "