Skip to content

Commit c027b8b

Browse files
committed
Merge branch 'develop' into feature/CIVIC-2105
2 parents 297e6b1 + 869d21b commit c027b8b

File tree

10 files changed

+313
-462
lines changed

10 files changed

+313
-462
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"dependencies": {
3-
"@civictheme/uikit": "github:civictheme/uikit#3505451--update-field-message-props"
3+
"@civictheme/uikit": "github:civictheme/uikit#main"
44
}
55
}

web/themes/contrib/civictheme/civictheme.post_update.php

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,60 @@ function civictheme_post_update_update_view_mode_civictheme_navigation_card_ref_
806806
if ($config_read) {
807807
$config_object = \Drupal::configFactory()->getEditable('core.entity_view_display.paragraph.civictheme_navigation_card_ref.default');
808808
$config_object->set('content.field_c_p_reference.settings.view_mode', 'civictheme_navigation_card');
809-
$config_object->save();return (string) new TranslatableMarkup('Updated view mode from "civictheme_snippet" to "civictheme_navigation_card".');
809+
$config_object->save();
810+
return (string) new TranslatableMarkup('Updated view mode from "civictheme_snippet" to "civictheme_navigation_card".');
810811
}
811812
return (string) new TranslatableMarkup('No update needed for view mode.');
812813
}
814+
815+
/**
816+
* Add field_c_b_link_in_mobile_menu field config and update form view.
817+
*
818+
* @SuppressWarnings(PHPMD.StaticAccess)
819+
*/
820+
function civictheme_post_update_add_search_link_field_to_search_component(): string {
821+
$block_field_configs = [
822+
'field.storage.block_content.field_c_b_link_in_mobile_menu' => 'field_storage_config',
823+
'field.field.block_content.civictheme_search.field_c_b_link_in_mobile_menu' => 'field_config',
824+
];
825+
826+
$config_path = \Drupal::service('extension.list.theme')->getPath('civictheme') . '/config/install';
827+
\Drupal::classResolver(CivicthemeUpdateHelper::class)->createConfigs($block_field_configs, $config_path);
828+
829+
$new_form_config = [
830+
'field_c_b_link_in_mobile_menu' => [
831+
'type' => 'boolean_checkbox',
832+
'weight' => 2,
833+
'region' => 'content',
834+
'settings' => [
835+
'display_label' => TRUE,
836+
],
837+
],
838+
];
839+
840+
\Drupal::classResolver(CivicthemeUpdateHelper::class)->updateFormDisplayConfig('block_content', 'civictheme_search', $new_form_config);
841+
842+
return (string) new TranslatableMarkup('Added field_c_b_link_in_mobile_menu field config and updated form view.');
843+
}
844+
845+
/**
846+
* Update editor config for D11 requirement (remove duplicate settings).
847+
*/
848+
function civictheme_post_update_update_editor_allowed_field(): string {
849+
$config_name = 'editor.editor.civictheme_rich_text';
850+
$config_object = \Drupal::configFactory()->getEditable($config_name);
851+
852+
// Fetch the existing allowed tags.
853+
$allowed_tags = $config_object->get('settings.plugins.ckeditor5_sourceEditing.allowed_tags');
854+
if (is_array($allowed_tags)) {
855+
$allowed_tags = array_filter($allowed_tags, function ($tag) {
856+
return $tag !== '<a hreflang target title class="ct-content-link ct-content-link--external ct-button--button ct-theme-dark">';
857+
});
858+
$config_object->set('settings.plugins.ckeditor5_sourceEditing.allowed_tags', $allowed_tags);
859+
860+
// Update the configuration with the modified allowed tags.
861+
$config_object->save();
862+
return (string) new TranslatableMarkup('Updated editor allowed field.');
863+
}
864+
return (string) new TranslatableMarkup('Allowed tags setting not set, aborting update.');
865+
}

web/themes/contrib/civictheme/civictheme_starter_kit/civictheme_starter_kit.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CivicTheme Starter Kit
22
type: theme
33
base theme: civictheme
44
description: 'CivicTheme Starter Kit description.'
5-
core_version_requirement: ^9 || ^10
5+
core_version_requirement: ^9 || ^10 || ^11
66
hidden: true
77

88
regions:

0 commit comments

Comments
 (0)