Skip to content

Commit 3a3b799

Browse files
committed
Fixing NemID fields population with webform field type
1 parent caed11e commit 3a3b799

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules/os2forms_nemid/os2forms_nemid.module

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,17 @@ function os2forms_nemid_webform_submission_form_alter(array &$form, FormStateInt
9595
}
9696

9797
}
98+
99+
/**
100+
* Implements hook_preprocess().
101+
*/
102+
function os2forms_nemid_preprocess(&$variables, $hook) {
103+
// Disable caching of 'webform' type field, as that breaks NemID integration.
104+
if ($hook == 'field') {
105+
$element = $variables['element'];
106+
if ($element['#field_type'] == 'webform') {
107+
// Disable caching.
108+
$variables['#cache']['max-age'] = 0;
109+
}
110+
}
111+
}

0 commit comments

Comments
 (0)