Commit 3f112e14 authored by Soames's avatar Soames
Browse files

Deprecation fixes / code format consistency

parent 1e166003
Loading
Loading
Loading
Loading
Loading
+3 −2
Changes for composer.json: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@
    "drupal/facets_block": "^2.0",
    "drupal/field_formatter_filter": "^2.0",
    "drupal/field_group": "^4.0",
    "drupal/field_group_link": "^3.3",
    "drupal/field_group_link": "dev-3.x#eb60db172213859ef6af9aa54e95bcb221cc2a86",
    "drupal/field_token_value": "^3.0",
    "drupal/fieldblock": "^2.4",
    "drupal/gin": "^4.0 || ^5.0",
@@ -57,7 +57,7 @@
    "drupal/menu_block": "^1.10",
    "drupal/metatag": "^2.1",
    "drupal/password_policy": "^4.0",
    "drupal/pathauto": "^1.12",
    "drupal/pathauto": "1.14",
    "drupal/rabbit_hole": "^2.0@beta",
    "drupal/redirect": "^1.8",
    "drupal/required_field_display": "^1.7",
@@ -78,6 +78,7 @@
    "drupal/views_menu_children_filter": "^4.0",
    "drupal/xmlsitemap": "^2.0",
    "sparksi/sector-patches": "*",
    "twig/twig": "~3.29.0",
    "wikimedia/composer-merge-plugin": "^2.1"
  },
  "conflict": {
+11 −5
Changes for modules/sector_media/sector_media.module: 11 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -41,11 +41,17 @@ function sector_media_form_alter(&$form, FormStateInterface $form_state, $form_i
            // No usages. Stop here, default works.
            return;
        }

        // Extra helper text on the delete form.
        $markup = "<p>Are you sure you want to delete <strong>" . $entity->getName() . "?</strong></p>";
        $markup .= "<p>This media item is <a href='" . $url->toString() . "'>used in either published content or revisions</a>. Are you sure you want to delete it?</p>";
        $placeholder_arguments = [
            '@name' => $entity->getName(),
            ':url' =>  $url->toString(),
        ];

        $markup = "<p>Are you sure you want to delete <strong>@name?</strong></p>";
        $markup .= "<p>This media item is <a href=\":url\">used in either published content or revisions</a>. Are you sure you want to delete it?</p>";
        $markup .= "<p>This action cannot be undone.</p>";
        $form['description']['#markup'] = new TranslatableMarkup($markup);
        $form['description']['#markup'] = new TranslatableMarkup($markup, $placeholder_arguments);
    }
}

@@ -74,11 +80,11 @@ function sector_media_token_info() {
function sector_media_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
    $replacements = [];

    if ($type == 'sector_media' && theme_get_setting('opengraph_image')) {
    if ($type == 'sector_media' && \Drupal::service('Drupal\Core\Extension\ThemeSettingsProvider')->getSetting('opengraph_image')) {
      foreach ($tokens as $name => $original) {
        switch ($name) {
          case 'opengraph_image':
            $media = Media::load(theme_get_setting('opengraph_image'));
            $media = Media::load(\Drupal::service('Drupal\Core\Extension\ThemeSettingsProvider')->getSetting('opengraph_image'));
            if (!$media->hasField('field_media_image')) {
                break;
            }
+10 −0
Changes for modules/sector_news/config/install/core.entity_view_mode.node.search_result.yml: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
langcode: en
status: false
dependencies:
  module:
    - node
id: node.search_result
label: 'Search result highlighting input'
description: ''
targetEntityType: node
cache: true
+11 −3
Changes for modules/sector_text_formats/modules/sector_embedded_content_examples/src/Plugin/EmbeddedContent/Disclosure.php: 11 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -38,7 +38,11 @@ class Disclosure extends EmbeddedContentPluginBase implements EmbeddedContentInt
    return [
      '#theme' => 'disclosure',
      '#summary' => $this->configuration['summary'],
      '#body' => check_markup($this->configuration['body']['value'], $this->configuration['body']['format']) ?? '',
      '#body' => [
        '#type' => 'processed_text',
        '#text' => $this->configuration['body']['value'],
        '#format' => $this->configuration['body']['format'],
      ],
      '#utility_classes' => []
    ];
  }
@@ -73,8 +77,12 @@ class Disclosure extends EmbeddedContentPluginBase implements EmbeddedContentInt
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {

    $body = check_markup($form_state->getValue('body'), 'sector_restricted_basic_html');
    $build = [
      '#type' => 'processed_text',
      '#text' => $form_state->getValue('body'),
      '#format' => 'sector_restricted_basic_html',
    ];
    $body = \Drupal::service('renderer')->renderInIsolation($build);

    $this->configuration['body'] = $body;
  }
Loading