Skip to content

Commit

Permalink
Issue #317: Done in PR #318
Browse files Browse the repository at this point in the history
  • Loading branch information
lexhouk authored Sep 16, 2024
2 parents 876a263 + e9e7a49 commit ee5070d
Show file tree
Hide file tree
Showing 29 changed files with 95 additions and 74 deletions.
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/update-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ assignees: ''

---

Update [core](https://www.drupal.org/project/drupal) from **CURRENT** to
**NEWER**. Compare versions
[here](https://git.drupalcode.org/project/drupal/-/compare/10.CURRENT...10.NEWER).
Update [core](https://www.drupal.org/project/drupal) from **CURRENT** to **NEWER**. Compare versions [here](https://git.drupalcode.org/project/drupal/-/compare/10.CURRENT...10.NEWER).
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"drupal/bootstrap": "3.32",
"drupal/captcha": "2.0.6",
"drupal/config_update": "2.0.0-alpha4",
"drupal/core": "10.2.3",
"drupal/core-composer-scaffold": "10.2.3",
"drupal/core": "10.3.5",
"drupal/core-composer-scaffold": "10.3.5",
"drupal/exception_mailer": "4.0.0",
"drupal/extlink": "2.0.2",
"drupal/features": "3.14",
Expand All @@ -23,7 +23,8 @@
"drupal/service": "2.0.0",
"drupal/seven": "1.0.0",
"drupal/standwithukraine": "2.0.2",
"drupal/symfony_mailer": "1.4.1"
"drupal/symfony_mailer": "1.4.1",
"php": "^8.3"
},
"require-dev": {
"drupal/config2php": "3.0.2",
Expand All @@ -37,7 +38,7 @@
"drupal/core": {
"Default theme favicon for administration theme": "https://www.drupal.org/files/issues/2019-12-14/default-theme-favicon-for-administration-theme-2981434-7.patch",
"Add events for matching entity hooks": "https://www.drupal.org/files/issues/2024-01-30/2551893-122.patch",
"News mode": "https://www.drupal.org/files/issues/2024-02-07/drupal-news-mode-3256060-16.patch"
"News mode": "https://www.drupal.org/files/issues/2024-09-10/drupal-news-mode-3256060-25.patch"
},
"drupal/exception_mailer": {
"Queue workers are broken": "https://www.drupal.org/files/issues/2023-10-25/exception-mailer-queue-worker-3395572-5.patch"
Expand Down
9 changes: 7 additions & 2 deletions d8.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: D8+
description: The installation profile for CMS Drupal 10 based on the most common modules and themes that form the basis for creating a stable site.

type: profile
core_version_requirement: ^10.2
version: 0.19.5.182
core_version_requirement: ^10.3
version: 0.20.0.183

php: 8.3

distribution:
name: D8+
Expand All @@ -17,13 +19,16 @@ dependencies:
- drupal:config
- drupal:contextual
- drupal:field_ui
- drupal:help
- drupal:node
- drupal:shortcut
- drupal:update

- admin_toolbar:admin_toolbar_search
- admin_toolbar:admin_toolbar_tools
- features:features_ui
- jquery_ui_draggable:jquery_ui_draggable
- jquery_ui_resizable:jquery_ui_resizable
- module_filter:module_filter
- service:service

Expand Down
19 changes: 18 additions & 1 deletion d8.install
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function d8_install(bool $is_syncing): void {
function d8_install_tasks(array &$install_state): array {
return [
'install_captcha_form' => [
'display_name' => t('Set up captcha settings'),
'display_name' => t('Activate captcha'),
'type' => 'form',
'function' => D8CaptchaForm::class,
],
Expand All @@ -45,6 +45,23 @@ function d8_update_last_removed(): int {
return 10203;
}

/**
* Check only for security updates, even for uninstalled extensions.
*/
function d8_update_10301(array &$sandbox): void {
\Drupal::configFactory()->getEditable('update.settings')
->set('check.disabled_extensions', TRUE)
->set('notification.threshold', 'security')
->save();
}

/**
* Install Help module.
*/
function d8_update_10302(array &$sandbox): void {
\Drupal::classResolver(D8Setup::class)->module('help');
}

/**
* Process list of update hooks.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
langcode: en
enable_globally: 0
enable_globally_on_admin_routes: false
default_challenge: 'recaptcha/reCAPTCHA'
default_challenge: recaptcha/reCAPTCHA
description: ''
title: ''
administration_mode: false
administration_mode_on_admin_routes: false
whitelist_ips: ''
wrong_captcha_response_message: 'The answer you entered for the CAPTCHA was not correct.'
default_validation: 1
persistence: 1
enable_stats: false
log_wrong_responses: false
wrong_captcha_response_message: 'The answer you entered for the CAPTCHA was not correct.'
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
langcode: en
status: true
message: 'I''m loading...'
message: "I'm loading..."
10 changes: 5 additions & 5 deletions modules/features/d8_captcha/d8_captcha.install
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ function d8_captcha_update_10101(array &$sandbox): void {
* Delete the description of CAPTCHA in translations.
*/
function d8_captcha_update_10102(array &$sandbox): void {
if (\Drupal::languageManager()->isMultilingual()) {
$languages = \Drupal::languageManager()->getLanguages();
$language = \Drupal::languageManager()->getDefaultLanguage()->getId();
if (($manager = \Drupal::languageManager())->isMultilingual()) {
$languages = $manager->getLanguages();
$language = $manager->getDefaultLanguage()->getId();

unset($languages[$language]);

foreach (array_keys($languages) as $language) {
\Drupal::languageManager()
$manager
->getLanguageConfigOverride($language, 'captcha.settings')
->set('description', '')
->clear('description')
->save();
}
}
Expand Down
4 changes: 2 additions & 2 deletions modules/features/d8_captcha/d8_captcha.module
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ function d8_captcha_library_info_alter(
): void {
if (
$extension === 'recaptcha' &&
isset($libraries[$name = $extension . '.invisible'])
isset($libraries[$name = "$extension.invisible"])
) {
/** @var \Drupal\Core\Extension\ExtensionPathResolver $resolver */
$resolver = \Drupal::service('extension.path.resolver');

$path = $resolver->getPath('module', 'd8_captcha');

$libraries[$name]['js'] = ['/' . $path . '/js/' . $name . '.js' => []];
$libraries[$name]['js'] = ["/$path/js/$name.js" => []];
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
langcode: en
extlink_use_external_js_file: false
extlink_exclude_admin_routes: false
extlink_target: true
Expand Down
2 changes: 1 addition & 1 deletion modules/features/d8_link/d8_link.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Provides a wrapper for the External Links module and related.
package: D8+

type: module
core_version_requirement: ^10
core_version_requirement: ^10.3

dependencies:
- drupal:link
Expand Down
4 changes: 1 addition & 3 deletions modules/features/d8_link/d8_link.module
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

/**
* @file
* Provides a wrapper for the External Links module and related...
*
* ...such as the Font Awesome Icons module.
* Provides a wrapper for the External Links module and related ones.
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@

namespace Drupal\d8_link\Plugin\Field\FieldFormatter;

use Drupal\Core\Field\Attribute\FieldFormatter;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Url;
use Drupal\d8_link\D8Url;
use Drupal\link\LinkItemInterface;
use Drupal\link\Plugin\Field\FieldFormatter\LinkFormatter;

/**
* Plugin implementation of the 'd8_link' formatter.
*
* @FieldFormatter(
* id = "d8_link",
* label = @Translation("D8+ Link"),
* description = @Translation("Delete the URL scheme and default sub-domain from the link title."),
* field_types = {
* "link"
* }
* )
*/
#[FieldFormatter(
id: 'd8_link',
label: new TranslatableMarkup('D8+ Link'),
description: new TranslatableMarkup('Delete the URL scheme and default sub-domain from the link title.'),
field_types: ['link'],
)]
class D8LinkFormatter extends LinkFormatter {

/**
Expand Down
1 change: 1 addition & 0 deletions modules/features/d8_mail/config/install/user.mail.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
langcode: en
cancel_confirm:
subject: 'Account cancellation request for [user:display-name] at [site:name]'
body: |-
Expand Down
4 changes: 3 additions & 1 deletion modules/features/d8_mail/d8_mail.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ description: Provides a wrapper for the Drupal Symfony Mailer module.
package: D8+

type: module
core_version_requirement: ^10
core_version_requirement: ^10.1

php: 8.3

dependencies:
- service:service
Expand Down
5 changes: 4 additions & 1 deletion modules/features/d8_mail/d8_mail.module
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ function d8_mail_help(
/**
* Implements hook_library_info_alter().
*/
function d8_mail_library_info_alter(array &$libraries, string $extension): void {
function d8_mail_library_info_alter(
array &$libraries,
string $extension
): void {
if ($extension === 'symfony_mailer') {
unset($libraries['test']['css']['theme']['css/test.email.css']);
}
Expand Down
8 changes: 1 addition & 7 deletions modules/features/d8_mail/d8_mail.services.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
services:
d8_mail.event_subscriber:
class: Drupal\d8_mail\EventSubscriber
arguments:
- '@entity_type.manager'
- '@email.validator'
- '@config.factory'
- '@messenger'
- '@string_translation'
- '@logger.factory'
autowire: true
tags:
- { name: event_subscriber }
19 changes: 13 additions & 6 deletions modules/features/d8_mail/src/D8MailBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

namespace Drupal\d8_mail;

use Drupal\Core\StringTranslation\StringTranslationTrait as CoreStringTranslationTrait;
use Drupal\d8\D8BuilderBase;
use Drupal\service\DateFormatterTrait;
use Drupal\service\RequestStackTrait;
use Drupal\service\StringTranslationTrait;
use Drupal\service\TimeTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;

Expand All @@ -16,8 +18,14 @@
*/
class D8MailBuilder extends D8BuilderBase {

use CoreStringTranslationTrait;
use DateFormatterTrait;
use RequestStackTrait;

use StringTranslationTrait {
StringTranslationTrait::getStringTranslation insteadof CoreStringTranslationTrait;
}

use TimeTrait;

/**
Expand All @@ -27,6 +35,7 @@ public static function create(ContainerInterface $container): static {
return parent::create($container)
->addDateFormatter()
->addRequestStack()
->addStringTranslation()
->addTime();
}

Expand All @@ -39,19 +48,17 @@ public static function create(ContainerInterface $container): static {
* @see d8_mail_preprocess_email_wrap__html()
*/
public function preprocessHtmlEmailWrapper(array &$variables): void {
$variables['logo'] = sprintf(
str_repeat('%s', 2),
$this->requestStack()->getCurrentRequest()->getSchemeAndHttpHost(),
theme_get_setting('logo')['url'],
);
$variables['logo'] =
$this->requestStack()->getCurrentRequest()->getSchemeAndHttpHost() .
theme_get_setting('logo')['url'];

/** @var \Drupal\symfony_mailer\InternalEmailInterface $email */
$email = $variables['email'];

$parameter = (array) $email->getParam('legacy_message');
$account = $parameter['params']['account'] ?? $email->getAccount();

$variables['welcome'] = t(
$variables['welcome'] = $this->t(
'Hello @recipient-name,',
['@recipient-name' => $account->getDisplayName()],
);
Expand Down
6 changes: 3 additions & 3 deletions modules/features/d8_mail/src/EventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ class EventSubscriber implements EventSubscriberInterface {
/**
* The common part of the status message and database log message.
*/
protected const MESSAGE = ' has been changed from %old to %new.';
protected const string MESSAGE = ' has been changed from %old to %new.';

/**
* The link label of the status message and database log message.
*/
protected const LABEL = 'The site E-mail address';
protected const string LABEL = 'The site E-mail address';

/**
* The prefix of the status message where the link will be inserted.
*/
protected const KEY = '@link';
protected const string KEY = '@link';

/**
* The base E-mail address of the site.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export:
folder: custom
langcode: en
1 change: 1 addition & 0 deletions modules/features/d8_setting/config/install/system.cron.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
threshold:
requirements_warning: 172800
requirements_error: 1209600
logging: false
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ display:
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
pagination_heading_level: h4
exposed_form:
type: basic
options:
Expand Down Expand Up @@ -607,7 +608,7 @@ display:
separator: ''
empty_column: false
responsive: priority-medium
default_sort_order: 'asc'
default_sort_order: asc
sortable: false
wid:
sortable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Provides a wrapper for the StandWithUkraine 🇺🇦 module.
package: D8+

type: module
core_version_requirement: ^10
core_version_requirement: ^10.1

dependencies:
- standwithukraine:standwithukraine
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
services:
standwithukraine.negotiator.d8:
class: Drupal\d8_standwithukraine\D8StandWithUkraineNegotiator
arguments:
- '@config.factory'
- '@theme.manager'
- '@current_route_match'
- '@plugin.manager.menu.local_task'
autowire: true
tags:
- { name: standwithukraine_negotiator }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
langcode: en
status: true
status: false
dependencies:
config:
- system.menu.footer
Expand Down
Loading

0 comments on commit ee5070d

Please sign in to comment.