Skip to content
Snippets Groups Projects
Commit ef9a5f2b authored by Max Bronsema's avatar Max Bronsema
Browse files

Improved function logic.

parent ddde9384
Branches
No related tags found
No related merge requests found
Pipeline #465816 failed
......@@ -384,16 +384,16 @@ public function updateGroupingLabelElement(ViewEntityInterface $view): bool {
public function addGroupingLabelElement(array &$handler, string $handler_type, ViewEntityInterface $view): bool {
$changed = FALSE;
// For each existing view add the grouping label element.
$views = $view->get('display');
foreach ($views as $view) {
$view->get($handler_type);
// For each existing view display add the grouping label element.
$displays = $view->get('display');
foreach ($displays as $display) {
$display->get($handler_type);
if (($handler_type === 'style')
&& isset($handler['plugin_id'], $handler['type'])
&& $handler['plugin_id'] === 'style'
&& ($handler['type'] === 'Grid' || $handler['type'] === 'HtmlList' || $handler['type'] === 'GridResponsive' || $handler['type'] === 'DefaultStyle')
&& !isset($handler['style']['grouping_label_element'])) {
$handler['style'] = ['grouping_label_element' => NULL];
$handler['style']['grouping_label_element'] = NULL;
$changed = TRUE;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment