Skip to content
Snippets Groups Projects
Commit 1ae74d01 authored by Liam Morland's avatar Liam Morland Committed by Lily Yan
Browse files

ISTWCMS-5252: Set all Webforms to use the access denied page

Create uw_cfg_common_update_9102().
parent 9e8b7107
No related branches found
No related tags found
1 merge request!193ISTWCMS-5252: Set all Webforms to use the access denied page
...@@ -11,6 +11,7 @@ use Drupal\taxonomy\Entity\Term; ...@@ -11,6 +11,7 @@ use Drupal\taxonomy\Entity\Term;
use Drupal\user\Entity\Role; use Drupal\user\Entity\Role;
use Drupal\uw_cfg_common\UwPermissions\UwPermissions; use Drupal\uw_cfg_common\UwPermissions\UwPermissions;
use Drupal\uw_cfg_common\UwRoles\UwRoles; use Drupal\uw_cfg_common\UwRoles\UwRoles;
use Drupal\webform\WebformInterface;
/** /**
* Implements hook_install(). * Implements hook_install().
...@@ -565,3 +566,15 @@ function uw_cfg_common_update_9101() { ...@@ -565,3 +566,15 @@ function uw_cfg_common_update_9101() {
} }
} }
} }
/**
* Set all Webforms to use the access denied page.
*/
function uw_cfg_common_update_9102() {
$webforms = \Drupal::entityTypeManager()->getStorage('webform')->loadMultiple();
foreach ($webforms as $webform) {
// This is set as the default in uw_cfg_common_webform_create().
$webform->setSetting('form_access_denied', WebformInterface::ACCESS_DENIED_PAGE);
$webform->save();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment