Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
WCMS
uw_sites_all
Commits
cf84a37a
Commit
cf84a37a
authored
Jun 24, 2021
by
Chris Shantz
Browse files
Merge branch '1.0.x' into prod/1.0.x
parents
a449167f
133ed31e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
1 deletion
+41
-1
config/install/webform.settings.yml
config/install/webform.settings.yml
+5
-1
uw_sites_all.info.yml
uw_sites_all.info.yml
+1
-0
uw_sites_all.install
uw_sites_all.install
+19
-0
uw_sites_all.module
uw_sites_all.module
+16
-0
No files found.
config/install/webform.settings.yml
View file @
cf84a37a
...
...
@@ -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
uw_sites_all.info.yml
View file @
cf84a37a
...
...
@@ -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
uw_sites_all.install
View file @
cf84a37a
...
...
@@ -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
();
}
uw_sites_all.module
View file @
cf84a37a
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment