diff --git a/CHANGELOG.md b/CHANGELOG.md index bf931e46..786f1917 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. +## [15.1.8](https://github.com/UN-OCHA/iasc8/compare/v15.1.7...v15.1.8) (2025-01-14) + +### Chores + +* Bump version of mariadb for local development ([2d64ea](https://github.com/UN-OCHA/iasc8/commit/2d64ea8556ea9f56ed6272899d6a0d1c2cefa27d)) +* Update all outdated drupal/* unocha/* drush/* packages. ([60db71](https://github.com/UN-OCHA/iasc8/commit/60db713dbfa772eca0372d7b24742cfa436165f9), [63aa90](https://github.com/UN-OCHA/iasc8/commit/63aa909170845c5af8db41ec9d6a97c7ea749b93), [9e774c](https://github.com/UN-OCHA/iasc8/commit/9e774cc54231e6955af28cc3d220963b9e9778ce), [a1399c](https://github.com/UN-OCHA/iasc8/commit/a1399c2c0645414bd671a48016273022aab364d6)) + +##### Deps + +* Bump phpoffice/phpspreadsheet from 2.3.2 to 2.3.5 ([b0233e](https://github.com/UN-OCHA/iasc8/commit/b0233e94504854ca9c4227796e088ae57e439ee3)) + +##### Tests + +* Bump the test MariaDB to match what the dev sites will use soon. ([39398c](https://github.com/UN-OCHA/iasc8/commit/39398cf2e659ad2fe7d2cbc5745be1d29dcdcc9a)) + ## [15.1.7](https://github.com/UN-OCHA/iasc8/compare/v15.1.6...v15.1.7) (2024-12-16) ### Chores diff --git a/PATCHES/user_expire-customize-notification-email.patch b/PATCHES/user_expire-customize-notification-email.patch deleted file mode 100644 index fc679575..00000000 --- a/PATCHES/user_expire-customize-notification-email.patch +++ /dev/null @@ -1,179 +0,0 @@ -diff --git a/config/install/user_expire.settings.yml b/config/install/user_expire.settings.yml -index 62f9e8c7d5a064d87448b0faf5811a08709370c7..ea9fb144d2add8031bcafc516fb46cca209eb6c9 100644 ---- a/config/install/user_expire.settings.yml -+++ b/config/install/user_expire.settings.yml -@@ -1,3 +1,7 @@ - frequency: 172800 - offset: 604800 - user_expire_roles: {} -+send_mail: true -+mail: -+ subject: "[site:name]: Account expiration warning" -+ body: "Hello [user:display-name]\r\n\r\nBecause you have not logged in recently, your account at [site:name] will be blocked in the near future. If you still use this site, please log in [site:login-url] to prevent your account being blocked.\r\n\r\n-- [site:name] team" -diff --git a/config/schema/user_expire.schema.yml b/config/schema/user_expire.schema.yml -index a46bc68eeea8b41fa1e7bde72008daf77d54032d..be0c3fca4e7604994e5c0070942ef79920eab454 100644 ---- a/config/schema/user_expire.schema.yml -+++ b/config/schema/user_expire.schema.yml -@@ -7,9 +7,21 @@ user_expire.settings: - frequency: - type: integer - label: 'Frequency time in seconds' -+ mail: -+ type: mapping -+ mapping: -+ subject: -+ type: string -+ label: 'Subject line for the notification email' -+ body: -+ type: string -+ label: 'Body for the notification email' - offset: - type: integer - label: 'Warning offset time in seconds' -+ send_mail: -+ type: boolean -+ label: 'Flag that enables or disables expiry emails' - user_expire_roles: - type: sequence - label: 'Roles and expire value' -diff --git a/src/Form/UserExpireSettingsForm.php b/src/Form/UserExpireSettingsForm.php -index f7824c09ad10612818c2cc3e2cc2a85e590377a7..cd2c4e515d0887df9a70fe0c7c72bc599de84033 100644 ---- a/src/Form/UserExpireSettingsForm.php -+++ b/src/Form/UserExpireSettingsForm.php -@@ -109,6 +109,50 @@ class UserExpireSettingsForm extends ConfigFormBase { - ]; - } - -+ // Enable or disable email notifications. -+ $form['send_mail'] = [ -+ '#type' => 'checkbox', -+ '#title' => $this->t('Send notification emails'), -+ '#default_value' => $config->get('send_mail') ?: TRUE, -+ '#description' => $this->t('Send a notification email to the user, starting at the defined offset time before account expiry.'), -+ ]; -+ -+ // Notification email template. -+ $form['mail'] = [ -+ '#type' => 'fieldset', -+ '#title' => $this->t('Notification email'), -+ ]; -+ -+ $form['mail']['settings'] = [ -+ '#type' => 'container', -+ '#states' => [ -+ // Hide the additional settings when this email is disabled. -+ 'invisible' => [ -+ 'input[name="send_mail"]' => ['checked' => FALSE], -+ ], -+ ], -+ ]; -+ -+ $form['mail']['settings']['notification_subject'] = [ -+ '#type' => 'textfield', -+ '#title' => $this->t('Subject'), -+ '#default_value' => $config->get('mail.subject') ?: '', -+ '#description' => $this->t('Subject line for the notification email.'), -+ '#maxlength' => 180, -+ ]; -+ -+ $form['mail']['settings']['notification_body'] = [ -+ '#type' => 'textarea', -+ '#title' => $this->t('Body'), -+ '#default_value' => $config->get('mail.body') ?: '', -+ '#description' => $this->t('Body for the notification email.'), -+ '#rows' => 15, -+ ]; -+ -+ $form['mail']['settings']['help'] = [ -+ '#markup' => $this->t('Available token variables for use in the email are: [site:name], [site:url], [site:mail], [user:display-name], [user:account-name], [user:mail], [site:login-url], [site:url-brief], [user:edit-url], [user:one-time-login-url], [user:cancel-url]'), -+ ]; -+ - return parent::buildForm($form, $form_state); - } - -@@ -160,6 +204,13 @@ class UserExpireSettingsForm extends ConfigFormBase { - } - - $config->set('user_expire_roles', $rules); -+ -+ // The notification email. -+ $config->set('send_mail', $form_state->getValue('send_mail')); -+ -+ $config->set('mail.subject', $form_state->getValue('notification_subject')); -+ $config->set('mail.body', $form_state->getValue('notification_body')); -+ - $config->save(); - } - -diff --git a/user_expire.module b/user_expire.module -index d4dcd8ba28b51ee8f54a7626d8b10443244520d9..9365c5db3b87e88dd03611a03656370e2b4f99cb 100644 ---- a/user_expire.module -+++ b/user_expire.module -@@ -5,6 +5,7 @@ - * Main module file for User expire module. - */ - -+use Drupal\Component\Render\PlainTextOutput; - use Drupal\Core\Database\Query\Condition; - use Drupal\Core\Database\StatementInterface; - use Drupal\Core\Datetime\DrupalDateTime; -@@ -332,12 +333,15 @@ function user_expire_expire_by_role_warning(): void { - ]); - } - else { -- $logger->info('Warning about expiring account @name by role', ['@name' => $account->getAccountName()]); -- \Drupal::service('plugin.manager.mail')->mail('user_expire', 'expiration_warning', $account->getEmail(), $account->getPreferredLangcode(), -- [ -- 'account' => $account, -- ] -- ); -+ // Send a notification email if configured to do so. -+ if ($config->get('send_mail')) { -+ $logger->info('Sending warning about expiring account @name by role', ['@name' => $account->getAccountName()]); -+ \Drupal::service('plugin.manager.mail')->mail('user_expire', 'expiration_warning', $account->getEmail(), $account->getPreferredLangcode(), -+ [ -+ 'account' => $account, -+ ] -+ ); -+ } - } - } - } -@@ -439,20 +443,22 @@ function user_expire_get_role_rules(): mixed { - */ - function user_expire_mail($key, &$message, $params): void { - if ($key == 'expiration_warning') { -- $site_name = \Drupal::config('system.site')->get('name'); -- // The subject. -- $message['subject'] = t('@site_name: Account expiration warning', ['@site_name' => $site_name]); -- // The body. -- $message['body'][] = t('Hello @user', ['@user' => $params['account']->getAccountName()]); -- // An empty string gives a newline. -- $message['body'][] = ''; -- $message['body'][] = t('Because you have not logged in recently, your account at @site_name will be blocked in the near future. If you still use this site, please log in @login_url to avoid having your account blocked.', -- [ -- '@site_name' => $site_name, -- '@login_url' => Url::fromRoute('entity.user.canonical', ['user' => \Drupal::currentUser()->id()], ['absolute' => TRUE])->toString(), -- ] -- ); -- $message['body'][] = ''; -- $message['body'][] = t('Thanks, @site_name', ['@site_name' => $site_name]); -+ $token_service = \Drupal::token(); -+ $language_manager = \Drupal::languageManager(); -+ $langcode = $message['langcode']; -+ $variables = ['user' => $params['account']]; -+ -+ $language = $language_manager->getLanguage($params['account']->getPreferredLangcode()); -+ $original_language = $language_manager->getConfigOverrideLanguage(); -+ $language_manager->setConfigOverrideLanguage($language); -+ -+ $config_factory = \Drupal::configFactory(); -+ $config = $config_factory->get('user_expire.settings'); -+ -+ $token_options = ['langcode' => $langcode, 'callback' => 'user_mail_tokens', 'clear' => TRUE]; -+ $message['subject'] .= PlainTextOutput::renderFromHtml($token_service->replace($config->get('mail.subject'), $variables, $token_options)); -+ $message['body'][] = $token_service->replace($config->get('mail.body'), $variables, $token_options); -+ -+ $language_manager->setConfigOverrideLanguage($original_language); - } - } diff --git a/composer.json b/composer.json index c6a37f53..7fd9ea58 100755 --- a/composer.json +++ b/composer.json @@ -83,7 +83,7 @@ "drupal/token": "^1.5", "drupal/token_filter": "^2.0", "drupal/twig_tweak": "^3.2", - "drupal/user_expire": "^1.0", + "drupal/user_expire": "^2", "drupal/username_enumeration_prevention": "^1.3", "drupal/variationcache": "^1.0", "drupal/views_data_export": "^1.1", @@ -230,5 +230,5 @@ } } }, - "version": "15.1.7" + "version": "15.1.8" } diff --git a/composer.lock b/composer.lock index d7a2685a..89297dd4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c46c8ccf8da15a63a4dcf55b72999690", + "content-hash": "5234989264808c11e2005e766dce174e", "packages": [ { "name": "algolia/places", @@ -133,16 +133,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.336.11", + "version": "3.337.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "442039c766a82f06ecfecb0ac2c610d6aaba228d" + "reference": "7e40cecb3ce66749bbd5eaa9f370de48c16acd6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/442039c766a82f06ecfecb0ac2c610d6aaba228d", - "reference": "442039c766a82f06ecfecb0ac2c610d6aaba228d", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7e40cecb3ce66749bbd5eaa9f370de48c16acd6c", + "reference": "7e40cecb3ce66749bbd5eaa9f370de48c16acd6c", "shasum": "" }, "require": { @@ -225,9 +225,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.336.11" + "source": "https://github.com/aws/aws-sdk-php/tree/3.337.0" }, - "time": "2025-01-08T19:06:59+00:00" + "time": "2025-01-15T19:58:52+00:00" }, { "name": "caxy/php-htmldiff", @@ -448,16 +448,16 @@ }, { "name": "commerceguys/addressing", - "version": "v2.2.3", + "version": "v2.2.4", "source": { "type": "git", "url": "https://github.com/commerceguys/addressing.git", - "reference": "ca69b9cc502867111e585f7c627894ffac6f328a" + "reference": "ea826dbe5b3fe76960073a2167d5cf996c811cda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/commerceguys/addressing/zipball/ca69b9cc502867111e585f7c627894ffac6f328a", - "reference": "ca69b9cc502867111e585f7c627894ffac6f328a", + "url": "https://api.github.com/repos/commerceguys/addressing/zipball/ea826dbe5b3fe76960073a2167d5cf996c811cda", + "reference": "ea826dbe5b3fe76960073a2167d5cf996c811cda", "shasum": "" }, "require": { @@ -506,9 +506,9 @@ ], "support": { "issues": "https://github.com/commerceguys/addressing/issues", - "source": "https://github.com/commerceguys/addressing/tree/v2.2.3" + "source": "https://github.com/commerceguys/addressing/tree/v2.2.4" }, - "time": "2024-11-11T16:07:47+00:00" + "time": "2025-01-13T16:03:24+00:00" }, { "name": "composer/installers", @@ -1722,17 +1722,17 @@ }, { "name": "drupal/address", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://git.drupalcode.org/project/address.git", - "reference": "2.0.2" + "reference": "2.0.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/address-2.0.2.zip", - "reference": "2.0.2", - "shasum": "62875933847d9dcab5584de9c88712fa372cab9d" + "url": "https://ftp.drupal.org/files/projects/address-2.0.3.zip", + "reference": "2.0.3", + "shasum": "fa8273cf5abd21fd8a58de77844011b122ab3aa6" }, "require": { "commerceguys/addressing": "^2.1.1", @@ -1747,8 +1747,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "2.0.2", - "datestamp": "1720108676", + "version": "2.0.3", + "datestamp": "1736773032", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -3993,17 +3993,17 @@ }, { "name": "drupal/geofield", - "version": "1.62.0", + "version": "1.64.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/geofield.git", - "reference": "8.x-1.62" + "reference": "8.x-1.64" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/geofield-8.x-1.62.zip", - "reference": "8.x-1.62", - "shasum": "0d5a59c934c96f38dcf2742f6d715316b695ec7e" + "url": "https://ftp.drupal.org/files/projects/geofield-8.x-1.64.zip", + "reference": "8.x-1.64", + "shasum": "300f8cf8bf4d0cf2660c5a7e81d56146d947b772" }, "require": { "drupal/core": "^9 || ^10 || ^11", @@ -4016,8 +4016,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.62", - "datestamp": "1730931913", + "version": "8.x-1.64", + "datestamp": "1736675456", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -5029,11 +5029,11 @@ ], "authors": [ { - "name": "Berdir", + "name": "berdir", "homepage": "https://www.drupal.org/user/214652" }, { - "name": "Dave Reid", + "name": "dave reid", "homepage": "https://www.drupal.org/user/53892" }, { @@ -6342,29 +6342,29 @@ }, { "name": "drupal/user_expire", - "version": "1.3.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/user_expire.git", - "reference": "8.x-1.3" + "reference": "2.1.0" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/user_expire-8.x-1.3.zip", - "reference": "8.x-1.3", - "shasum": "58f6225567a854a3d7f7b5eaa7c15bf37873cb49" + "url": "https://ftp.drupal.org/files/projects/user_expire-2.1.0.zip", + "reference": "2.1.0", + "shasum": "cdaf39f4813d75f65d7a4579631487a3b49604d8" }, "require": { - "drupal/core": "^9 || ^10" + "drupal/core": "^10.3 || ^11 || ^12" }, "require-dev": { - "drupal/rules": "^3.0@alpha" + "drupal/rules": "^4.0" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.3", - "datestamp": "1725558574", + "version": "2.1.0", + "datestamp": "1736892990", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -6387,16 +6387,24 @@ "role": "Co-maintainer" }, { - "name": "joegraduate", - "homepage": "https://www.drupal.org/user/789384" + "name": "Shelane French (shelane)", + "homepage": "https://www.drupal.org/u/shelane", + "role": "Co-maintainer" + }, + { + "name": "Joe Parsons (joegraduate)", + "homepage": "https://www.drupal.org/u/joegraduate", + "role": "Co-maintainer" }, { - "name": "shelane", - "homepage": "https://www.drupal.org/user/2674989" + "name": "Troy Dean (tadean)", + "homepage": "https://www.drupal.org/u/tadean", + "role": "Co-maintainer" }, { - "name": "trackleft2", - "homepage": "https://www.drupal.org/user/2860655" + "name": "Chris Green (trackleft2)", + "homepage": "https://www.drupal.org/u/trackleft2", + "role": "Co-maintainer" } ], "description": "Allows an administrator to define a date on which to expire a user account.", @@ -7743,7 +7751,7 @@ "version": "1.0.2 ", "dist": { "type": "zip", - "url": "https://api.github.com/repos/drgullin/icheck/zipball/8a6eb37bd7dab1e843c1b630c91c6398ff409d05" + "url": "https://github.com/dargullin/icheck/archive/refs/tags/1.0.2.zip" }, "type": "drupal-library", "extra": { @@ -9314,16 +9322,16 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "2.3.5", + "version": "2.3.6", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "d836f2d7308a192441ccd1546545890b378af913" + "reference": "098b848ee6688cb9a252d9ce97889defc517ee88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/d836f2d7308a192441ccd1546545890b378af913", - "reference": "d836f2d7308a192441ccd1546545890b378af913", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/098b848ee6688cb9a252d9ce97889defc517ee88", + "reference": "098b848ee6688cb9a252d9ce97889defc517ee88", "shasum": "" }, "require": { @@ -9412,9 +9420,9 @@ ], "support": { "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", - "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/2.3.5" + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/2.3.6" }, - "time": "2024-12-27T05:17:46+00:00" + "time": "2025-01-12T03:22:26+00:00" }, { "name": "phpowermove/docblock", @@ -15831,16 +15839,16 @@ }, { "name": "open-telemetry/gen-otlp-protobuf", - "version": "1.2.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", - "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d" + "reference": "585bafddd4ae6565de154610b10a787a455c9ba0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/66c3b98e998a726691c92e6405a82e6e7b8b169d", - "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/585bafddd4ae6565de154610b10a787a455c9ba0", + "reference": "585bafddd4ae6565de154610b10a787a455c9ba0", "shasum": "" }, "require": { @@ -15890,7 +15898,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-10-30T11:49:49+00:00" + "time": "2025-01-15T23:07:07+00:00" }, { "name": "open-telemetry/sdk", @@ -19712,16 +19720,16 @@ }, { "name": "weitzman/drupal-test-traits", - "version": "2.4.2", + "version": "2.5.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/dtt.git", - "reference": "4705ec0a8414189aa28373bc672189dce93077be" + "reference": "664201b00140f9b935fcb9f3eef012c6638ec0c5" }, "dist": { "type": "zip", - "url": "https://git.drupalcode.org/api/v4/projects/project%2Fdtt/repository/archive.zip?sha=4705ec0a8414189aa28373bc672189dce93077be", - "reference": "4705ec0a8414189aa28373bc672189dce93077be", + "url": "https://git.drupalcode.org/api/v4/projects/project%2Fdtt/repository/archive.zip?sha=664201b00140f9b935fcb9f3eef012c6638ec0c5", + "reference": "664201b00140f9b935fcb9f3eef012c6638ec0c5", "shasum": "" }, "require": { @@ -19738,20 +19746,20 @@ }, "type": "library", "extra": { - "installer-paths": { - "web/core": [ - "type:drupal-core" - ] - }, "drupal-scaffold": { "locations": { "web-root": "web/" }, "file-mapping": { + "[project-root]/.gitignore": false, "[project-root]/.editorconfig": false, - "[project-root]/.gitattributes": false, - "[project-root]/.gitignore": false + "[project-root]/.gitattributes": false } + }, + "installer-paths": { + "web/core": [ + "type:drupal-core" + ] } }, "autoload": { @@ -19771,9 +19779,9 @@ ], "description": "Traits for testing Drupal sites that have user content (versus unpopulated sites).", "support": { - "source": "https://git.drupalcode.org/project/dtt/-/tree/2.4.2" + "source": "https://git.drupalcode.org/project/dtt/-/tree/2.5.0" }, - "time": "2024-10-22T11:02:37+00:00" + "time": "2024-10-30T23:28:39+00:00" }, { "name": "weitzman/logintrait", diff --git a/composer.patches.json b/composer.patches.json index a023ae2a..2b82d4cb 100644 --- a/composer.patches.json +++ b/composer.patches.json @@ -28,7 +28,6 @@ "#3084967-41: Don't store full extracted file content data in the database": "https://www.drupal.org/files/issues/2021-08-10/search_api_attachments_files_cache-3084967-41.patch" }, "drupal/user_expire": { - "Allow the notification email to be customised": "PATCHES/user_expire-customize-notification-email.patch", "Reset expiration when user is reactivated": "PATCHES/user_expire-reset-expiration-on-reactivation.patch" }, "drupal/username_enumeration_prevention": { diff --git a/config/user_expire.settings.yml b/config/user_expire.settings.yml index a21f2d3b..3daed6f2 100644 --- a/config/user_expire.settings.yml +++ b/config/user_expire.settings.yml @@ -1,10 +1,15 @@ _core: default_config_hash: PeDvVH4C3IZ7QFkvC1BUv3BZJVc7jLwQmJAEttVuVOw frequency: 432000 -mail: - subject: '[site:name]: Account expiration warning' - body: "Hello [user:display-name]\r\n\r\nBecause you have not logged in recently, your account at [site:name] will be de-activated in the near future. If you still use this site, please log in [site:login-url] to avoid having your account de-activated.\r\n\r\nThanks, [site:name]" offset: 604800 -send_mail: 1 user_expire_roles: authenticated: 15552000 +send_expiration_warnings: true +expiration_warning_mail: + subject: "[site:name]: Account expiration warning" + body: |- + Hello [user:display-name] + + Because you have not logged in recently, your account at [site:name] will be blocked in the near future. If you still use this site, log in now [site:login-url] to prevent your account being blocked. + + -- [site:name] team