Skip to content

Commit

Permalink
Fixing NemID fields population with webform field type
Browse files Browse the repository at this point in the history
  • Loading branch information
stankut committed Mar 3, 2020
1 parent caed11e commit 3a3b799
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/os2forms_nemid/os2forms_nemid.module
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,17 @@ function os2forms_nemid_webform_submission_form_alter(array &$form, FormStateInt
}

}

/**
* Implements hook_preprocess().
*/
function os2forms_nemid_preprocess(&$variables, $hook) {
// Disable caching of 'webform' type field, as that breaks NemID integration.
if ($hook == 'field') {
$element = $variables['element'];
if ($element['#field_type'] == 'webform') {
// Disable caching.
$variables['#cache']['max-age'] = 0;
}
}
}

0 comments on commit 3a3b799

Please sign in to comment.