Skip to content

Commit

Permalink
Encrypt subelements
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Aug 9, 2024
1 parent e1eb43c commit 39b6f04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public function enabledEncrypt(): void {

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

$changed = FALSE;
foreach ($elements as $key => $element) {
if (!isset($config['element'][$key])) {
if (!isset($config['element'][$key]) || $config['element'][$key]['encrypt_profile'] === NULL) {
$config['element'][$key] = [
'encrypt' => TRUE,
'encrypt_profile' => $defaultEncryptionProfile,
Expand Down
2 changes: 1 addition & 1 deletion modules/os2forms_encrypt/src/Helper/Os2FormsEncryptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function enableEncryption(WebformInterface $webform): void {
}

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

if (empty($elements)) {
return;
Expand Down

0 comments on commit 39b6f04

Please sign in to comment.