Commit cf84a37a authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents a449167f 133ed31e
......@@ -221,4 +221,8 @@ requirements:
bootstrap: true
spam: true
langcode: en
third_party_settings: { }
third_party_settings:
captcha:
replace_administration_mode: false
honeypot:
honeypot: true
......@@ -161,6 +161,7 @@ dependencies:
- drupal:webform_ui
- drupal:workbench_access
- drupal:workflows
- uw_ckeditor_plugins:uw_ckeditor_plugins
- uw_ws_ofis:uw_ws_ofis
libraries:
- uw_sites_all/uw-sites-all-adminimal
......@@ -58,9 +58,28 @@ function uw_sites_all_uninstall() {
}
}
/**
* Implements hook_update_N().
*/
/**
* Enables OFIS module.
*/
function uw_sites_all_update_8101(&$sandbox) {
\Drupal::service('module_installer')->install(['uw_ws_ofis']);
}
/**
* Enables UW CKEditor Plugins module.
*/
function uw_sites_all_update_8102(&$sandbox) {
\Drupal::service('module_installer')->install(['uw_ckeditor_plugins']);
}
/**
* Protect all Webforms with Honeypot.
*/
function uw_sites_all_update_8103() {
$config = \Drupal::service('config.factory')->getEditable('webform.settings');
$config->set('third_party_settings.honeypot.honeypot', TRUE)->save();
}
......@@ -5,6 +5,7 @@
* Workbench module file.
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\menu_link_content\Entity\MenuLinkContent;
......@@ -126,3 +127,18 @@ function uw_sites_all_update_projects_alter(&$projects) {
$project['info']['version'] = preg_replace('/-uw_wcms\d*$/', '', $project['info']['version']);
}
}
/**
* Implements hook_ENTITY_TYPE_presave().
*/
function uw_sites_all_webform_presave(EntityInterface $webform): void {
// Add a Webform CAPTCHA component to each newly-created Webform.
if ($webform->isNew()) {
$elements = [
'captcha' => [
'#type' => 'captcha',
],
];
$webform->setElements($elements);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment