Skip to content

Commit

Permalink
Merge branch 'main' into UHF-X_use_default_lang_resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Jussiles committed Nov 22, 2023
2 parents a25c35c + f2ee2c0 commit ee11b91
Show file tree
Hide file tree
Showing 168 changed files with 17,252 additions and 391 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

- name: Clone platform
run: |
git clone --depth=1 --branch=9.x https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT
git clone --depth=1 https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT
rm -rf $DRUPAL_ROOT/.git
- name: Install required composer dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.phpunit.*
node_modules
31 changes: 18 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"minimum-stability": "dev",
"require": {
"ext-curl": "*",
"drupal/core": "^9.5",
"drupal/core": "^10.1.5",
"drupal/admin_toolbar": "^3.0",
"drupal/allowed_formats": "^2.0",
"drupal/ckeditor": "^1.0",
"drupal/config_filter": "^2.6",
"drupal/config_ignore": "^3.0",
"drupal/config_rewrite": "^1.4",
Expand All @@ -25,7 +26,8 @@
"drupal/external_entities": "^2.0@alpha",
"drupal/field_group": "^3.1",
"drupal/focal_point": "^2.0",
"drupal/gin_toolbar": "^1.0",
"drupal/gin_toolbar": "^1.0@rc",
"drupal/hal": "^2.0",
"drupal/helfi_api_base": "*",
"drupal/helfi_tpr": "*",
"drupal/image_style_quality": "^1.4",
Expand All @@ -41,6 +43,7 @@
"drupal/paragraphs_asymmetric_translation_widgets": "^1.0",
"drupal/pathauto": "^1.8",
"drupal/publication_date": "^2.0@beta",
"drupal/rdf": "^2.0",
"drupal/redirect": "^1.6",
"drupal/role_delegation": "^1.1",
"drupal/scheduler": "^1.3",
Expand All @@ -59,26 +62,24 @@
"php": "^8.1"
},
"conflict": {
"drupal/core-recommended": "<9.5",
"drupal/core": "<10.1",
"drupal/ctools": "<3.11 || ^4.0.1",
"drupal/helfi_media_map": "*",
"drush/drush": "<11"
"drush/drush": "<12"
},
"extra": {
"patches": {
"drupal/content_lock": {
"[#UHF-4553] Fix unlock content button redirect": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/82081691e4a6d05b3716052d5fff46a04027bdc3/patches/content-lock-uhf-4553.patch"
"[#UHF-4553] Fix unlock content button redirect": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/82081691e4a6d05b3716052d5fff46a04027bdc3/patches/content-lock-uhf-4553.patch",
"https://www.drupal.org/project/content_lock/issues/3343964": "https://www.drupal.org/files/issues/2023-05-22/3343964-5.patch"
},
"drupal/core": {
"[#UHF-181] Hide untranslated menu links": "https://www.drupal.org/files/issues/2021-03-05/3091246-allow-menu-tree-manipulators-alter-12-1.patch",
"[#UHF-920] Token for base URL (https://www.drupal.org/project/drupal/issues/1088112). @todo This can be removed in D10": "https://www.drupal.org/files/issues/2020-10-06/1088112-63.patch",
"[#UHF-3812] Ajax exposed filters not working for multiple instances of the same Views block placed on one page (https://www.drupal.org/project/drupal/issues/3163299)": "https://www.drupal.org/files/issues/2023-05-07/3163299-104-D9.patch",
"[#UHF-3087] Non-published menu links as parent (https://www.drupal.org/project/drupal/issues/2807629). @todo This can be removed in D10": "https://www.drupal.org/files/issues/2022-12-16/2807629-75.patch",
"[#UHF-4325] Strip whitespaces from twig debug comments": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/f7c0e380e2deb9a1b46bdf779fb27a945b466575/patches/drupal_core_strip_debug_mode_whitespaces_9.3.x.patch",
"[#UHF-181] Hide untranslated menu links (https://www.drupal.org/project/drupal/issues/3091246)": "https://www.drupal.org/files/issues/2023-10-02/3091246--allow-menu-tree-manipulators-alter--23.patch",
"[#UHF-3812] Ajax exposed filters not working for multiple instances of the same Views block placed on one page (https://www.drupal.org/project/drupal/issues/3163299)": "https://www.drupal.org/files/issues/2023-05-07/3163299-104-D10.patch",
"[#UHF-4325] Strip whitespaces from twig debug comments": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/b628bc051d82a1883768364050aa833824bd48c8/patches/drupal_core_strip_debug_mode_whitespaces_10.1.x.patch",
"[#UHF-7008] Core localization file download URL is wrong (https://www.drupal.org/project/drupal/issues/3022876)": "https://git.drupalcode.org/project/drupal/-/commit/40a96136b2dfe4322338508dffa636f6cb407900.patch",
"[#UHF-7008] Add multilingual support for caching basefield definitions (https://www.drupal.org/project/drupal/issues/3114824)": "https://www.drupal.org/files/issues/2020-02-20/3114824_2.patch",
"[#UHF-7008] Admin toolbar and contextual links should always be rendered in the admin language (https://www.drupal.org/project/drupal/issues/2313309)": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/a42c905a162c8510348b17cdf60000a0a7f82037/patches/drupal-2313309-render-admin-toolbar-with-admin-language.patch",
"[#UHF-8334]": "https://www.drupal.org/files/issues/2023-03-17/2706241-74.patch"
"[#UHF-7008] Admin toolbar and contextual links should always be rendered in the admin language (https://www.drupal.org/project/drupal/issues/2313309)": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/a42c905a162c8510348b17cdf60000a0a7f82037/patches/drupal-2313309-render-admin-toolbar-with-admin-language.patch"
},
"drupal/default_content": {
"https://www.drupal.org/project/default_content/issues/2640734#comment-14638943": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/main/patches/default_content_2.0.0-alpha2-2640734_manual_imports-e164a354.patch"
Expand All @@ -91,13 +92,17 @@
"[#UHF-2059] Enhancements for the Admin UI": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/fdccb32397cc6fa19b4d0077b21a2b18aa6be297/patches/helfi_customizations_for_paragraphs_widget_8.x-1.12.patch"
},
"drupal/publication_date": {
"[#UHF-7721] Fixed node preview when publication date is not set. (https://www.drupal.org/project/publication_date/issues/3074373)": "https://www.drupal.org/files/issues/2022-12-20/publication_date_is_required_for_completing_the_form-3074373-11.patch"
"[#UHF-7721] Fixed node preview when publication date is not set. (https://www.drupal.org/i/3074373)": "https://www.drupal.org/files/issues/2022-12-20/publication_date_is_required_for_completing_the_form-3074373-11.patch",
"[#UHF-9113] Fix PHP 8.2 deprecation issue with PublishedAtOrNowComputed class. (https://www.drupal.org/i/3328575)": "https://www.drupal.org/files/issues/2023-05-31/3328575-5-fix-bux-publicate-date.patch"
},
"drupal/social_media": {
"Add missing schema to social media. (https://www.drupal.org/project/social_media/issues/2986819)": "https://git.drupalcode.org/project/social_media/-/commit/1964f42e5a6fb5d7a97fdf8ec5ca259bc6c5b19a.patch"
},
"drupal/simple_sitemap": {
"[#UHF-8514] Fix frontpage URLs in sitemap. (https://www.drupal.org/i/3264573)": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/55722f695264bbaf6062f46e400e905c761fd5b7/patches/simple_sitemap-3264573-respect-frontpage-configuration.patch"
},
"drupal/view_unpublished": {
"[#UHF-9256] Fix missing dynamic permission dependencies.": "https://raw.githubusercontent.com/City-of-Helsinki/drupal-helfi-platform-config/cbb944ae79643ba7ed895db3fac7f3b3d90ac850/patches/view_unpublished_permissions_missing_dependencies.patch"
}
}
}
Expand Down
24 changes: 24 additions & 0 deletions documentation/update.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Update instructions

## Updating from 3.x to 4.x

Helfi platform config 4.x brings support to Drupal 10.

### Updating configuration

Get your local environment up and running.

- Update the Drupal packages and helfi packages to latest versions.
- `composer require drupal/core:^10.1 drupal/core-composer-scaffold:^10.1 drush/drush:^12 drupal/helfi_platform_config:^4.0 drupal/hdbt:^6.0 drupal/hdbt_admin:^3.0 -W`
- If the installation fails due to conflicting problems, like: `drupal/raven is locked to version 4.0.16 and an update of this package was not requested.`, then include the `drupal/raven:^4.0` to the requirements, like so: `composer require drupal/core:^10.1 drupal/core-composer-scaffold:^10.1 drush/drush:^12 drupal/helfi_platform_config:^4.0 drupal/hdbt:^6.0 drupal/hdbt_admin:^3.0 drupal/raven:^4.0 -W`
- Update the core-dev package separately, as it's dev-dependency: `composer require drupal/core-dev:^10.1 --dev -W`
- After the packages have been installed, run the database updates
- `make drush-updb` or `drush updb`
- Export your configuration
- `make drush-cex` or `drush cex -y`
- Go through the changed configurations and manually discard any unwanted changes.

### Updating remote environments (test/stage/prod)

There shouldn't be any problems after deployment, but if any occurs, cache clear and running an extra drush deploy command should fix the problems.
- `drush cr; drush deploy`


## Updating from 2.x to 3.x

### Updating configuration
Expand Down
7 changes: 6 additions & 1 deletion helfi_platform_config.module
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ function helfi_platform_config_field_config_presave(
function helfi_platform_config_rebuild_handler_settings(
FieldConfigBase $field
): void {
if ($field->isSyncing() || $field->getType() !== 'entity_reference_revisions') {
if (
\Drupal::isConfigSyncing() ||
$field->isSyncing() ||
$field->getType() !== 'entity_reference_revisions'
) {
return;
}

$collection = [];
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler */
$moduleHandler = Drupal::service('module_handler');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ display:
date_format: long
custom_date_format: ''
timezone: ''
tooltip:
date_format: ''
custom_date_format: ''
time_diff:
enabled: false
future_format: '@interval hence'
past_format: '@interval ago'
granularity: 2
refresh: 60
operations:
id: operations
table: node
Expand Down
3 changes: 2 additions & 1 deletion modules/hdbt_admin_tools/hdbt_admin_tools.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ dependencies:
- admin_toolbar:admin_toolbar
- admin_toolbar_tools:admin_toolbar_tools
- config_ignore:config_ignore
- drupal:ckeditor
- drupal:config_translation
- drupal:editor
- drupal:node
- drupal:options
- drupal:views
- linkit:linkit
'interface translation project': hdbt_admin_tools
'interface translation server pattern': modules/contrib/helfi_platform_config/modules/hdbt_admin_tools/translations/%language.po
9 changes: 7 additions & 2 deletions modules/hdbt_admin_tools/hdbt_admin_tools.install
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ declare(strict_types = 1);
/**
* Installs Helfi admin tools module.
*/
function hdbt_admin_tools_install(): void {
if (!Drupal::moduleHandler()->moduleExists('config_ignore')) {
function hdbt_admin_tools_install(bool $is_syncing) : void {
// Do not perform following steps if the module is being installed as part
// of a configuration import.
if (
$is_syncing ||
!Drupal::moduleHandler()->moduleExists('config_ignore')
) {
return;
}

Expand Down
3 changes: 2 additions & 1 deletion modules/hdbt_admin_tools/hdbt_admin_tools.module
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,8 @@ function hdbt_admin_tools_entity_base_field_info(EntityTypeInterface $entity_typ
function hdbt_admin_tools_entity_presave($entity): void {
if (
!method_exists($entity, 'hasField') ||
!$entity->hasField('color_palette')
!$entity->hasField('color_palette') ||
\Drupal::isConfigSyncing()
) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ class SelectIconWidget extends WidgetBase {
*/
protected Config $selectIconConfig;

/**
* Contains the array of options for the widget.
*
* @var array
*/
protected array $options;

/**
* Constructs a WidgetBase object.
*
Expand Down
22 changes: 0 additions & 22 deletions modules/hdbt_admin_tools/translations/fi.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
msgid ""
msgstr ""

msgid ""
"Allows linking to this content using a URL fragment (#). Must be "
"unique."
msgstr ""
"Sallii linkityksen tähän sisältöön URL-fragmentin (#) avulla. "
"Täytyy olla uniikki."

msgid "Basic tags"
msgstr "Perustägit"

Expand Down Expand Up @@ -100,24 +93,9 @@ msgstr "Miten muutit sivua?"
msgid "Hide sidebar navigation from this page"
msgstr "Piilota sivupalkin navigaatio tältä sivulta"

msgid ""
"I have made sure that the description "
"of this link clearly states that it will open in a new tab. "
"<a href=\"@wcag-techniques\" target=\"_blank\">See WCAG 3.2.5 accessibility requirement (the link opens in a new tab).</a>"
msgstr ""
"Olen huolehtinut, että tämän linkin kuvauksessa "
"kerrotaan selkeästi sen aukeavan uuteen välilehteen. "
"<a href=\"@wcag-techniques\" target=\"_blank\">Katso WCAG 3.2.5 saavutettavuusvaatimukset (linkki avautuu uuteen välilehteen).</a>"

msgid "Light"
msgstr "Vaalea"

msgid "Open in new window/tab"
msgstr "Avaa uudessa ikkunassa / välilehdellä"

msgid "The link meets the accessibility requirements"
msgstr "Linkki täyttää saavutettavuusvaatimukset"

msgctxt "HDBT Admin editorial - One-time login link"
msgid "One-time login link for %user_name"
msgstr "Kertakäyttöinen kirjautumislinkki käyttäjälle %user_name"
Expand Down
12 changes: 9 additions & 3 deletions modules/helfi_calculator/helfi_calculator.install
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
/**
* Installs helfi calculator module.
*/
function helfi_calculator_install() : void {
// Adds paragraph related configs to config ignore.
if (!Drupal::moduleHandler()->moduleExists('config_ignore')) {
function helfi_calculator_install(bool $is_syncing) : void {
// Do not perform following steps if the module is being installed as part
// of a configuration import.
if (
$is_syncing ||
!Drupal::moduleHandler()->moduleExists('config_ignore')
) {
return;
}

// Adds paragraph related configs to config ignore.
$config = Drupal::configFactory()->getEditable('config_ignore.settings');
$ignored = $config->get('ignored_config_entities') ?? [];

Expand Down
4 changes: 4 additions & 0 deletions modules/helfi_ckeditor/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/**/*
webpack.config.js
webpack.config.dev.js
webpack.config.build.js
76 changes: 76 additions & 0 deletions modules/helfi_ckeditor/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"root": true,
"env": {
"browser": true,
"node": true,
"es6": true
},
"extends": [
"airbnb-base",
"prettier",
"plugin:import/recommended"
],
"plugins": [
"jsdoc"
],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"globals": {
"Drupal": true,
"drupalSettings": true,
"drupalTranslations": true,
"jQuery": true,
"_": true,
"Cookies": true,
"Backbone": true,
"Modernizr": true,
"Popper": true,
"Shepherd": true,
"Sortable": true,
"once": true,
"CKEDITOR": true,
"tabbable": true
},
"rules": {
"arrow-spacing": ["warn", { "before": true, "after": true }],
"comma-spacing": ["warn", { "before": false, "after": true }],
"consistent-return": ["off"],
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"max-nested-callbacks": ["warn", 5],
"no-plusplus": [
"warn",
{
"allowForLoopAfterthoughts": true
}
],
"no-param-reassign": ["off"],
"no-prototype-builtins": ["off"],
"no-unused-vars": ["warn"],
"no-underscore-dangle": ["off"],
"no-whitespace-before-property": "warn",
"object-curly-spacing": ["error", "always"],
"operator-linebreak": [
"error",
"after",
{ "overrides": { "?": "ignore", ":": "ignore" } }
],
"prefer-arrow-callback":["off"],
"quotes": ["warn", "single"],
"semi": ["error", "always"],
"space-in-parens": ["warn", "never"],
"space-before-function-paren": ["error", "never"],
"valid-jsdoc": [
"warn",
{
"prefer": {
"returns": "return",
"property": "prop"
},
"requireReturn": false
}
]
}
}
1 change: 1 addition & 0 deletions modules/helfi_ckeditor/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.9.0
4 changes: 4 additions & 0 deletions modules/helfi_ckeditor/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"singleQuote": true
}
Loading

0 comments on commit ee11b91

Please sign in to comment.