diff --git a/modules/oe_whitelabel_helper/oe_whitelabel_helper.module b/modules/oe_whitelabel_helper/oe_whitelabel_helper.module index 9f0dc4b85..5e96c0172 100755 --- a/modules/oe_whitelabel_helper/oe_whitelabel_helper.module +++ b/modules/oe_whitelabel_helper/oe_whitelabel_helper.module @@ -8,6 +8,7 @@ declare(strict_types = 1); use Drupal\Core\Render\Element; +use Drupal\Core\Template\Attribute; /** * Implements hook_locale_translation_projects_alter(). diff --git a/modules/oe_whitelabel_helper/src/Plugin/field_group/FieldGroupFormatter/MultiColumn.php b/modules/oe_whitelabel_helper/src/Plugin/field_group/FieldGroupFormatter/MultiColumn.php index 754806e40..6afd114e9 100644 --- a/modules/oe_whitelabel_helper/src/Plugin/field_group/FieldGroupFormatter/MultiColumn.php +++ b/modules/oe_whitelabel_helper/src/Plugin/field_group/FieldGroupFormatter/MultiColumn.php @@ -1,5 +1,7 @@ '', 'second_column' => '', 'hide_table_if_empty' => FALSE, ] + parent::defaultSettings($context); - - return $defaults; } /** * {@inheritdoc} */ - public function settingsForm() { + public function settingsForm(): array { $form = parent::settingsForm(); $form['first_column'] = [ @@ -136,7 +136,7 @@ public function settingsForm() { /** * {@inheritdoc} */ - public function settingsSummary() { + public function settingsSummary(): array { $summary = parent::settingsSummary(); $summary[] = $this->t('Display results as a 2 column table.'); @@ -146,7 +146,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - public function preRender(&$element, $rendering_object) { + public function preRender(&$element, $rendering_object): void { parent::preRender($element, $rendering_object); $element['#mode'] = $this->context; @@ -216,7 +216,7 @@ public function preRender(&$element, $rendering_object) { * @return array * Table row definition on success or an empty array otherwise. */ - protected function buildRow(array $element, $field_name) { + protected function buildRow(array $element, string $field_name): array { $item = $this->getRowItem($element, $field_name); $build = []; @@ -240,13 +240,13 @@ protected function buildRow(array $element, $field_name) { * @return array * Item definition array on success or empty array otherwise. */ - protected function getRowItem(array $element, $field_name) { - $item = isset($element[$field_name]) ? $element[$field_name] : []; + protected function getRowItem(array $element, string $field_name): array { + $item = $element[$field_name] ?? []; $is_empty = !is_array($item) || !array_intersect($this->renderApiProperties, array_keys($item)); if ($is_empty && $this->getSetting('always_show_field_value') && isset($element['#entity_type'], $element['#bundle'])) { $field_definitions = $this->entityFieldManager->getFieldDefinitions($element['#entity_type'], $element['#bundle']); - $field_definition = isset($field_definitions[$field_name]) ? $field_definitions[$field_name] : NULL; + $field_definition = $field_definitions[$field_name] ?? NULL; if ($field_definition instanceof FieldConfigInterface) { $is_empty = FALSE; diff --git a/modules/oe_whitelabel_helper/src/Plugin/field_group/templates/field--two-column.html.twig b/modules/oe_whitelabel_helper/src/Plugin/field_group/templates/field--two-column.html.twig index 344a722d7..700147dc5 100755 --- a/modules/oe_whitelabel_helper/src/Plugin/field_group/templates/field--two-column.html.twig +++ b/modules/oe_whitelabel_helper/src/Plugin/field_group/templates/field--two-column.html.twig @@ -13,7 +13,6 @@ {% set title_classes = [ 'field__label', - 'fw-bold', 'col-12', 'col-md-6', label_display == 'visually_hidden' ? 'visually-hidden', diff --git a/oe_whitelabel.theme b/oe_whitelabel.theme index 1a578b0d1..a5f7f545d 100755 --- a/oe_whitelabel.theme +++ b/oe_whitelabel.theme @@ -135,7 +135,7 @@ function oe_whitelabel_preprocess(&$variables) { * Implements hook_preprocess(). */ function oe_whitelabel_preprocess_pattern_card(array &$variables): void { - if ($variables['variant'] != 'user_profile') { + if ($variables['variant'] !== 'user_profile') { return; } @@ -171,7 +171,7 @@ function oe_whitelabel_preprocess_pattern_card(array &$variables): void { $variables['subtitle'] = [ 'content' => $variables['subtitle'], 'tag' => "div", - 'classes' => "mb-4 mt-4", + 'classes' => "mb-4 mt-4 text-muted", ]; $variables['image'] = [