Skip to content

Commit 39b6f04

Browse files
committed
Encrypt subelements
1 parent e1eb43c commit 39b6f04

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/os2forms_encrypt/src/Commands/Os2FormsEncryptCommands.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ public function enabledEncrypt(): void {
6666

6767
/** @var \Drupal\webform\Entity\Webform $webform */
6868
foreach ($webforms as $webform) {
69-
$elements = $webform->getElementsDecoded();
69+
$elements = $webform->getElementsDecodedAndFlattened();
7070
$config = $webform->getThirdPartySettings('webform_encrypt');
7171

7272
$changed = FALSE;
7373
foreach ($elements as $key => $element) {
74-
if (!isset($config['element'][$key])) {
74+
if (!isset($config['element'][$key]) || $config['element'][$key]['encrypt_profile'] === NULL) {
7575
$config['element'][$key] = [
7676
'encrypt' => TRUE,
7777
'encrypt_profile' => $defaultEncryptionProfile,

modules/os2forms_encrypt/src/Helper/Os2FormsEncryptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function enableEncryption(WebformInterface $webform): void {
8989
}
9090

9191
// Check that there are any elements to enable encryption on.
92-
$elements = $webform->getElementsDecoded();
92+
$elements = $webform->getElementsDecodedAndFlattened();
9393

9494
if (empty($elements)) {
9595
return;

0 commit comments

Comments
 (0)