Przeglądaj źródła

updated simplenews from 1-beta to 2-beta, translated subscription form

bach 3 lat temu
rodzic
commit
30a75e09db

+ 1 - 1
composer.json

@@ -77,7 +77,7 @@
         "drupal/search_api_page": "^1.x-dev",
         "drupal/search_api_solr": "^4.1",
         "drupal/select_translation": "^1.x-dev",
-        "drupal/simplenews": "^1.x-dev",
+        "drupal/simplenews": "^2.0@beta",
         "drupal/social_media_links": "^2.8",
         "drupal/string_translation_ui": "^1.2",
         "drupal/strings_i18n_json_export": "1.x-dev@dev",

+ 21 - 15
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": "a1a5ce6f3a1ccf973b41d14aa97def76",
+    "content-hash": "23c6cb51f19ca9d27cd9298f1d2c8fb8",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -5834,6 +5834,8 @@
                     "language negociation exeption https://www.drupal.org/project/drupal/issues/3134349": "https://www.drupal.org/files/issues/2020-06-02/3134349-9.patch",
                     "Cannot save translated nodes after upgrading to 8.8 due to invalid path https://www.drupal.org/project/drupal/issues/3101344": "https://www.drupal.org/files/issues/2021-03-01/3101344-drupal-core-fix-permissions-checking-while-node-translating-64.patch",
                     "ConfigImporter->checkOp() https://www.drupal.org/project/drupal/issues/3198715": "https://www.drupal.org/files/issues/2021-02-16/error-running-config-import-delete-on-null-3198715-3.patch",
+                    "Entity view/form mode formatter/widget settings have no translation UI 1 https://www.drupal.org/project/drupal/issues/2546212": "https://www.drupal.org/files/issues/2020-12-04/2546212-168-actions.patch",
+                    "Entity view/form mode formatter/widget settings have no translation UI 2 https://www.drupal.org/project/drupal/issues/2546212": "https://www.drupal.org/files/issues/2020-12-04/2546212-168.patch",
                     "https://www.drupal.org/project/drupal/issues/2943172": "https://www.drupal.org/files/issues/2018-07-05/2943172-kernel-test-base-3.patch"
                 }
             },
@@ -10432,6 +10434,9 @@
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
                     }
+                },
+                "patches_applied": {
+                    "Manifest doesn't have a maskable icon https://www.drupal.org/project/pwa/issues/3165433": "https://www.drupal.org/files/issues/2020-08-26/pwa_icon_purpose-3165433-9.patch"
                 }
             },
             "notification-url": "https://packages.drupal.org/8/downloads",
@@ -11049,30 +11054,32 @@
         },
         {
             "name": "drupal/simplenews",
-            "version": "dev-1.x",
+            "version": "2.0.0-beta2",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/simplenews.git",
-                "reference": "3ca318b30cf771ea7fd611aeecbb6214fae1cda3"
+                "reference": "8.x-2.0-beta2"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://ftp.drupal.org/files/projects/simplenews-8.x-2.0-beta2.zip",
+                "reference": "8.x-2.0-beta2",
+                "shasum": "e33699acad01501ff6a8fc474a53e7ca45244f83"
             },
             "require": {
-                "drupal/core": "^8"
+                "drupal/core": "^8.8 || ^9"
             },
             "require-dev": {
-                "drupal/monitoring": "*",
-                "drupal/simplenews_scheduler": "*"
+                "drupal/monitoring": "*"
             },
             "type": "drupal-module",
             "extra": {
-                "branch-alias": {
-                    "dev-1.x": "1.x-dev"
-                },
                 "drupal": {
-                    "version": "8.x-1.0-beta1+11-dev",
-                    "datestamp": "1570272486",
+                    "version": "8.x-2.0-beta2",
+                    "datestamp": "1592298547",
                     "security-coverage": {
                         "status": "not-covered",
-                        "message": "Dev releases are not covered by Drupal security advisories."
+                        "message": "Beta releases are not covered by Drupal security advisories."
                     }
                 }
             },
@@ -11110,8 +11117,7 @@
             "homepage": "https://www.drupal.org/project/simplenews",
             "support": {
                 "source": "https://git.drupalcode.org/project/simplenews"
-            },
-            "time": "2019-10-05T10:43:00+00:00"
+            }
         },
         {
             "name": "drupal/smart_trim",
@@ -19539,7 +19545,7 @@
         "drupal/payment_commerce": 20,
         "drupal/search_api_page": 20,
         "drupal/select_translation": 20,
-        "drupal/simplenews": 20,
+        "drupal/simplenews": 10,
         "drupal/strings_i18n_json_export": 20,
         "drupal/telephone_formatter": 10,
         "drupal/translate_side_by_side": 20,

+ 0 - 1
config/sync/core.entity_form_display.simplenews_subscriber.simplenews_subscriber.account.yml

@@ -4,7 +4,6 @@ status: true
 dependencies:
   config:
     - core.entity_form_mode.simplenews_subscriber.account
-    - field.field.simplenews_subscriber.simplenews_subscriber.subscriptions
   module:
     - simplenews
 _core:

+ 1 - 2
config/sync/core.entity_form_display.simplenews_subscriber.simplenews_subscriber.default.yml

@@ -2,8 +2,7 @@ uuid: 68b2586e-6b2e-4d18-94e4-3a7844c5f12b
 langcode: en
 status: true
 dependencies:
-  config:
-    - field.field.simplenews_subscriber.simplenews_subscriber.subscriptions
+  config: {  }
   module:
     - simplenews
 _core:

+ 0 - 25
config/sync/field.field.simplenews_subscriber.simplenews_subscriber.subscriptions.yml

@@ -1,25 +0,0 @@
-uuid: 5c76fa02-bca2-4e1a-b7a1-ee0250f863cb
-langcode: en
-status: true
-dependencies:
-  config:
-    - field.storage.simplenews_subscriber.subscriptions
-  module:
-    - simplenews
-_core:
-  default_config_hash: '-FGoXJQMTtfhnYhAdYmmB815lFLwEn09sI0nyn2EbKM'
-id: simplenews_subscriber.simplenews_subscriber.subscriptions
-field_name: subscriptions
-entity_type: simplenews_subscriber
-bundle: simplenews_subscriber
-label: Subscriptions
-description: ''
-required: false
-translatable: false
-default_value: {  }
-default_value_callback: ''
-settings:
-  handler: 'default:simplenews_newsletter'
-  handler_settings:
-    target_bundles: null
-field_type: simplenews_subscription

+ 0 - 21
config/sync/field.storage.simplenews_subscriber.subscriptions.yml

@@ -1,21 +0,0 @@
-uuid: 9692ac0e-4f66-4374-b221-6baaf0925877
-langcode: und
-status: true
-dependencies:
-  module:
-    - simplenews
-_core:
-  default_config_hash: wPBNO4_O9cizdnYp2mpq2Dd3O163g-2v5v6_yazR4MA
-id: simplenews_subscriber.subscriptions
-field_name: subscriptions
-entity_type: simplenews_subscriber
-type: simplenews_subscription
-settings:
-  target_type: simplenews_newsletter
-module: simplenews
-locked: false
-cardinality: -1
-translatable: true
-indexes: {  }
-persist_with_no_fields: false
-custom_storage: false

+ 2 - 0
config/sync/language/fr/block.block.materiosimplenewssubscription.yml

@@ -0,0 +1,2 @@
+settings:
+  label: 'Inscription newsletter Materio'

+ 0 - 2
config/sync/language/fr/views.view.simplenews_subscribers.yml

@@ -25,8 +25,6 @@ display:
           label: Courriel
         user_name:
           label: 'Nom d''utilisateur'
-        subscriptions:
-          separator: ', '
         status:
           label: Actif
         created:

+ 1 - 0
config/sync/simplenews.settings.yml

@@ -23,6 +23,7 @@ subscription:
   confirm_combined_line_unsubscribe_unsubscribed: 'Already unsubscribed from [simplenews-newsletter:name]'
   confirm_subscribe_page: ''
   confirm_unsubscribe_page: ''
+  tidy_unconfirmed: 0
 mail:
   use_cron: true
   throttle: 20

+ 62 - 63
config/sync/views.view.simplenews_subscribers.yml

@@ -2,8 +2,7 @@ uuid: 53a979eb-9ee5-4a9b-b4fb-602e19e052f7
 langcode: en
 status: true
 dependencies:
-  config:
-    - field.storage.simplenews_subscriber.subscriptions
+  config: {  }
   module:
     - simplenews
     - user
@@ -306,67 +305,6 @@ display:
           hide_alter_empty: true
           entity_type: simplenews_subscriber
           plugin_id: simplenews_user_name
-        subscriptions:
-          id: subscriptions
-          table: simplenews_subscriber__subscriptions
-          field: subscriptions
-          relationship: none
-          group_type: group
-          admin_label: ''
-          label: Subscriptions
-          exclude: false
-          alter:
-            alter_text: false
-            text: ''
-            make_link: false
-            path: ''
-            absolute: false
-            external: false
-            replace_spaces: false
-            path_case: none
-            trim_whitespace: false
-            alt: ''
-            rel: ''
-            link_class: ''
-            prefix: ''
-            suffix: ''
-            target: ''
-            nl2br: false
-            max_length: null
-            word_boundary: true
-            ellipsis: true
-            more_link: false
-            more_link_text: ''
-            more_link_path: ''
-            strip_tags: false
-            trim: false
-            preserve_tags: ''
-            html: false
-          element_type: ''
-          element_class: ''
-          element_label_type: ''
-          element_label_class: ''
-          element_label_colon: true
-          element_wrapper_type: ''
-          element_wrapper_class: ''
-          element_default_classes: true
-          empty: ''
-          hide_empty: false
-          empty_zero: false
-          hide_alter_empty: true
-          click_sort_column: target_id
-          type: simplenews_subscription_status
-          group_column: ''
-          group_columns: {  }
-          group_rows: true
-          delta_limit: 0
-          delta_offset: 0
-          delta_reversed: false
-          delta_first_last: false
-          multi_type: ul
-          separator: ', '
-          field_api_classes: false
-          plugin_id: field
         status:
           id: status
           table: simplenews_subscriber
@@ -543,6 +481,67 @@ display:
           destination: true
           entity_type: simplenews_subscriber
           plugin_id: entity_operations
+        subscriptions_target_id:
+          id: subscriptions_target_id
+          table: simplenews_subscriber__subscriptions
+          field: subscriptions_target_id
+          relationship: none
+          group_type: group
+          admin_label: ''
+          label: Subscriptions
+          exclude: false
+          alter:
+            alter_text: false
+            text: ''
+            make_link: false
+            path: ''
+            absolute: false
+            external: false
+            replace_spaces: false
+            path_case: none
+            trim_whitespace: false
+            alt: ''
+            rel: ''
+            link_class: ''
+            prefix: ''
+            suffix: ''
+            target: ''
+            nl2br: false
+            max_length: null
+            word_boundary: true
+            ellipsis: true
+            more_link: false
+            more_link_text: ''
+            more_link_path: ''
+            strip_tags: false
+            trim: false
+            preserve_tags: ''
+            html: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: true
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_empty: false
+          empty_zero: false
+          hide_alter_empty: true
+          click_sort_column: target_id
+          type: simplenews_subscription_status
+          group_column: ''
+          group_columns: {  }
+          group_rows: true
+          delta_limit: 0
+          delta_offset: 0
+          delta_reversed: false
+          delta_first_last: false
+          multi_type: ul
+          separator: ', '
+          field_api_classes: false
+          plugin_id: field
       filters:
         mail:
           id: mail

+ 4 - 12
web/modules/custom/materio_simplenews/src/Plugin/Block/MaterioSimplenewsSubscriptionBlock.php

@@ -163,20 +163,12 @@ class MaterioSimplenewsSubscriptionBlock extends BlockBase implements ContainerF
     $form_object = $this->entityTypeManager->getFormObject('simplenews_subscriber', 'materio_block');
     $form_object->setUniqueId($this->configuration['unique_id']);
     $form_object->setNewsletterIds($this->configuration['newsletters']);
-    $form_object->message = $this->configuration['message'];
+    $form_object->message = t($this->configuration['message']);
 
     // Set the entity on the form.
-    if ($user = \Drupal::currentUser()) {
-      if ($subscriber = simplenews_subscriber_load_by_uid($user->id())) {
-        $form_object->setEntity($subscriber);
-      }
-      else {
-        $form_object->setEntity(Subscriber::create()->fillFromAccount($user));
-      }
-    }
-    else {
-      $form_object->setEntity(Subscriber::create());
-    }
+    $user = \Drupal::currentUser();
+    $form_object->setEntity(Subscriber::loadByUid($user->id(), 'create'));
+
 
     return $this->formBuilder->getForm($form_object);
   }

Plik diff jest za duży
+ 1 - 1
web/themes/custom/materiotheme/assets/dist/report.html


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików