Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WCMS
uw_sites_all
Commits
72ce8e93
Commit
72ce8e93
authored
Jul 20, 2021
by
Chris Shantz
Browse files
Merge branch '1.0.x' into prod/1.0.x
parents
8dc02473
4fd03442
Changes
4
Show whitespace changes
Inline
Side-by-side
config/install/node_revision_delete.settings.yml
View file @
72ce8e93
node_revision_delete_cron
:
50
node_revision_delete_cron
:
50
node_revision_delete_time
:
-1
node_revision_delete_time
:
86400
node_revision_delete_minimum_age_to_delete_time
:
node_revision_delete_minimum_age_to_delete_time
:
max_number
:
12
max_number
:
12
time
:
months
time
:
months
node_revision_delete_when_to_delete_time
:
node_revision_delete_when_to_delete_time
:
max_number
:
12
max_number
:
12
time
:
months
time
:
months
delete_newer
:
false
disable_donation
:
1
uw_sites_all.info.yml
View file @
72ce8e93
...
@@ -161,6 +161,7 @@ dependencies:
...
@@ -161,6 +161,7 @@ dependencies:
-
drupal:webform_ui
-
drupal:webform_ui
-
drupal:workbench_access
-
drupal:workbench_access
-
drupal:workflows
-
drupal:workflows
-
override_node_options:override_node_options
-
uw_ckeditor_plugins:uw_ckeditor_plugins
-
uw_ckeditor_plugins:uw_ckeditor_plugins
-
uw_ws_ofis:uw_ws_ofis
-
uw_ws_ofis:uw_ws_ofis
libraries
:
libraries
:
...
...
uw_sites_all.install
View file @
72ce8e93
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
* Install, update and uninstall for UW Sites all.
* Install, update and uninstall for UW Sites all.
*/
*/
use
Drupal\user\Entity\Role
;
/**
/**
* Implements hook_install().
* Implements hook_install().
*/
*/
...
@@ -83,3 +85,62 @@ function uw_sites_all_update_8103() {
...
@@ -83,3 +85,62 @@ function uw_sites_all_update_8103() {
$config
=
\
Drupal
::
service
(
'config.factory'
)
->
getEditable
(
'webform.settings'
);
$config
=
\
Drupal
::
service
(
'config.factory'
)
->
getEditable
(
'webform.settings'
);
$config
->
set
(
'third_party_settings.honeypot.honeypot'
,
TRUE
)
->
save
();
$config
->
set
(
'third_party_settings.honeypot.honeypot'
,
TRUE
)
->
save
();
}
}
/**
* Enable Override Node Options module and assigns permissions to roles.
*/
function
uw_sites_all_update_8104
()
{
\
Drupal
::
service
(
'module_installer'
)
->
install
([
'override_node_options'
]);
// List of permissions needed to be applied to roles.
$permissions
=
[
'enter uw_ct_blog revision log entry'
,
'enter uw_ct_catalog_item revision log entry'
,
'enter uw_ct_contact revision log entry'
,
'enter uw_ct_event revision log entry'
,
'enter uw_ct_news_item revision log entry'
,
'enter uw_ct_profile revision log entry'
,
'enter uw_ct_web_page revision log entry'
,
'override uw_ct_blog promote to front page option'
,
'override uw_ct_blog published option'
,
'override uw_ct_blog revision option'
,
'override uw_ct_blog sticky option'
,
'override uw_ct_catalog_item published option'
,
'override uw_ct_catalog_item revision option'
,
'override uw_ct_contact published option'
,
'override uw_ct_contact revision option'
,
'override uw_ct_event promote to front page option'
,
'override uw_ct_event published option'
,
'override uw_ct_event revision option'
,
'override uw_ct_event sticky option'
,
'override uw_ct_news_item promote to front page option'
,
'override uw_ct_news_item published option'
,
'override uw_ct_news_item revision option'
,
'override uw_ct_news_item sticky option'
,
'override uw_ct_profile published option'
,
'override uw_ct_profile revision option'
,
'override uw_ct_web_page published option'
,
'override uw_ct_web_page revision option'
,
];
// Roles that require updated permissions.
$role_ids
=
[
'uw_role_site_manager'
,
'uw_role_content_editor'
,
'uw_role_content_author'
,
];
$roles
=
Role
::
loadMultiple
(
$role_ids
);
// Grant all all roles.
foreach
(
$permissions
as
$permission
)
{
$roles
[
'uw_role_site_manager'
]
->
grantPermission
(
$permission
);
$roles
[
'uw_role_content_editor'
]
->
grantPermission
(
$permission
);
$roles
[
'uw_role_content_author'
]
->
grantPermission
(
$permission
);
}
// Save role with new permissions.
$roles
[
'uw_role_site_manager'
]
->
save
();
$roles
[
'uw_role_content_editor'
]
->
save
();
$roles
[
'uw_role_content_author'
]
->
save
();
}
uw_sites_all.module
View file @
72ce8e93
...
@@ -5,9 +5,9 @@
...
@@ -5,9 +5,9 @@
* Workbench module file.
* Workbench module file.
*/
*/
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\menu_link_content
\
Entity\MenuLinkContent
;
use
Drupal\menu_link_content
\
Entity\MenuLinkContent
;
use
Drupal\webform\WebformInterface
;
/**
/**
* Implements hook_form_BASE_FORM_ID_alter().
* Implements hook_form_BASE_FORM_ID_alter().
...
@@ -131,9 +131,9 @@ function uw_sites_all_update_projects_alter(&$projects) {
...
@@ -131,9 +131,9 @@ function uw_sites_all_update_projects_alter(&$projects) {
/**
/**
* Implements hook_ENTITY_TYPE_presave().
* Implements hook_ENTITY_TYPE_presave().
*/
*/
function
uw_sites_all_webform_presave
(
Entity
Interface
$webform
):
void
{
function
uw_sites_all_webform_presave
(
Webform
Interface
$webform
):
void
{
// Add a Webform CAPTCHA component to each newly-created Webform.
// Add a Webform CAPTCHA component to each newly-created Webform.
if
(
$webform
->
isNew
())
{
if
(
$webform
->
isNew
()
&&
empty
(
$webform
->
getElementsRaw
())
)
{
$elements
=
[
$elements
=
[
'captcha'
=>
[
'captcha'
=>
[
'#type'
=>
'captcha'
,
'#type'
=>
'captcha'
,
...
...
Write
Preview
Supports
Markdown
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