Skip to content
Snippets Groups Projects
Commit eb8c25c6 authored by GitLab CI's avatar GitLab CI
Browse files

Merge branch 'develop' into 'main'

Merging develop into main

See merge request !350
parents d125332f 54c5155d
No related branches found
No related tags found
1 merge request!350Merging develop into main
Pipeline #1356973 passed
......@@ -53,7 +53,7 @@
"#3195171 Fix view header group rendering": "https://www.drupal.org/files/issues/2022-01-05/3195171-7-fix-view-header-group-rendering.patch",
"#3180227 Missing options for entity refernces in views": "https://www.drupal.org/files/issues/2020-11-02/3180227-2.patch",
"#local Json API and entity reference warnings": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/jsonapi-entityref-warning-10.3.patch",
"#local Insert Media inline in CKEditor widget": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/5758.diff",
"#local Issue 3168966 Insert Media inline in CKEditor widget": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/5758.diff",
"#3228298 Empty path alias exception": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3228298.diff?v=2",
"#3227816 Hide password reset link": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3227816.diff",
"#3249628 Comments and paragraphs": "https://www.drupal.org/files/issues/2022-12-11/1415-11.diff",
......@@ -258,6 +258,10 @@
"drupal/wysiwyg_template": {
"#3354588 Drupal 10 compatible": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3354588.diff"
},
"drupal/zoom_video": {
"#3488128 Schema": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3488128.diff",
"#3488135 Empty URL": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3488135.diff"
},
"grahl/ldap": {
"#Local Remove deprecation warnings": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/grahl-ldap.patch"
},
......
This diff is collapsed.
diff --git a/config/install/zoom_video.settings.yml b/config/install/zoom_video.settings.yml
new file mode 100644
index 0000000000000000000000000000000000000000..7cafa14cce5f6842a2a1f84029af077e89bf36a0
--- /dev/null
+++ b/config/install/zoom_video.settings.yml
@@ -0,0 +1,2 @@
+sdk_key: ''
+sdk_secret: ''
diff --git a/config/schema/zoom.video.schema.yml b/config/schema/zoom.video.schema.yml
new file mode 100644
index 0000000000000000000000000000000000000000..75eb23fa90173623fd2c59c16f438bef32bca085
--- /dev/null
+++ b/config/schema/zoom.video.schema.yml
@@ -0,0 +1,10 @@
+zoom_video.settings:
+ type: config_object
+ label: 'Zoom Video settings'
+ mapping:
+ sdk_key:
+ type: string
+ label: 'Client ID'
+ sdk_secret:
+ type: string
+ label: 'Client Secret'
diff --git a/src/Plugin/Field/FieldFormatter/ZoomVideoFormatter.php b/src/Plugin/Field/FieldFormatter/ZoomVideoFormatter.php
index ac430088c1e0a938e81afe3d37c13cd93bd667e6..f9c76fd1478a432d9877e0bd4c291ae9d5c84605 100644
--- a/src/Plugin/Field/FieldFormatter/ZoomVideoFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/ZoomVideoFormatter.php
@@ -92,6 +92,9 @@ class ZoomVideoFormatter extends FormatterBase {
foreach ($items as $delta => $item) {
$meeting_number = $item->get('meeting_number')->getValue();
$meeting_password = $item->get('password')->getValue();
+ if ($meeting_number === NULL || $meeting_password === NULL) {
+ continue;
+ }
$elements[$delta] = [
'#theme' => 'zoom_video_formatter_template',
@@ -103,20 +106,22 @@ class ZoomVideoFormatter extends FormatterBase {
];
}
- // Attach the zoom_video settings to drupalSettings.
- $elements['#attached']['drupalSettings']['zoom_video'] = [
- 'sdk_key' => $config->get('sdk_key'),
- // @todo We need to improve related JS code to handle multiple values.
- 'meetingNumber' => $meeting_number ?? '',
- 'password' => $meeting_password ?? '',
- ];
+ if (count($elements) > 0) {
+ // Attach the zoom_video settings to drupalSettings.
+ $elements['#attached']['drupalSettings']['zoom_video'] = [
+ 'sdk_key' => $config->get('sdk_key'),
+ // @todo We need to improve related JS code to handle multiple values.
+ 'meetingNumber' => $meeting_number ?? '',
+ 'password' => $meeting_password ?? '',
+ ];
- // Attach the current user settings to drupalSettings.
- $elements['#attached']['drupalSettings']['user'] = [
- 'userName' => $this->currentUser->getAccountName(),
- 'userEmail' => $this->currentUser->getEmail(),
- 'isAuthenticated' => $this->currentUser->isAuthenticated(),
- ];
+ // Attach the current user settings to drupalSettings.
+ $elements['#attached']['drupalSettings']['user'] = [
+ 'userName' => $this->currentUser->getAccountName(),
+ 'userEmail' => $this->currentUser->getEmail(),
+ 'isAuthenticated' => $this->currentUser->isAuthenticated(),
+ ];
+ }
return $elements;
}
diff --git a/src/Plugin/Field/FieldType/ZoomVideoField.php b/src/Plugin/Field/FieldType/ZoomVideoField.php
index 3f7976a96f28a443ea28f905bf9465476fd5a34c..a78b1184dad7b59fce9fb8dd183d2e91d79670fc 100644
--- a/src/Plugin/Field/FieldType/ZoomVideoField.php
+++ b/src/Plugin/Field/FieldType/ZoomVideoField.php
@@ -47,6 +47,9 @@ class ZoomVideoField extends FieldItemBase {
public function preSave(): void {
$value = $this->getValue();
preg_match('/\/j\/(\d+)\?pwd=([a-zA-Z0-9]+)/', $value['meeting_url'], $matches);
+ if (count($matches) !== 3) {
+ return;
+ }
$value['meeting_number'] = $matches[1];
$value['password'] = $matches[2];
$this->setValue($value);
This diff is collapsed.
......@@ -53,6 +53,7 @@
"#3195171 Fix view header group rendering": "https://www.drupal.org/files/issues/2022-01-05/3195171-7-fix-view-header-group-rendering.patch",
"#3180227 Missing options for entity refernces in views": "https://www.drupal.org/files/issues/2020-11-02/3180227-2.patch",
"#local Json API and entity reference warnings": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/jsonapi-entityref-warning-10.3.patch",
"#local Issue 3168966 Insert Media inline in CKEditor widget": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/5758-2.diff",
"#3228298 Empty path alias exception": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3228298.diff?v=2",
"#3227816 Hide password reset link": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3227816.diff",
"#3249628 Comments and paragraphs": "https://www.drupal.org/files/issues/2022-12-11/1415-11.diff",
......@@ -255,6 +256,10 @@
"drupal/wysiwyg_template": {
"#3354588 Drupal 10 compatible": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3354588.diff"
},
"drupal/zoom_video": {
"#3488128 Schema": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3488128.diff",
"#3488135 Empty URL": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3488135.diff"
},
"grahl/ldap": {
"#Local Remove deprecation warnings": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/grahl-ldap.patch"
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment