Skip to content
Snippets Groups Projects
Commit 1189667b authored by Michael Lee's avatar Michael Lee
Browse files

Merge branch 'main' into userprotect

parents e58378b6 a75718dd
No related branches found
No related tags found
1 merge request!21apply userprotect install patch
......@@ -280,6 +280,9 @@
"drupal/entity_embed": {
"3077225": "https://www.drupal.org/files/issues/2019-12-11/3077225-10.reduce-invalid-config-logs.patch"
},
"drupal/google_analytics": {
"3373921": "https://git.drupalcode.org/project/google_analytics/-/merge_requests/33.patch"
},
"drupal/honeypot": {
"2811189": "https://www.drupal.org/files/issues/2022-05-25/honeypot-field_weight-2811189-27_0.patch"
},
......
This diff is collapsed.
......@@ -3686,6 +3686,9 @@
},
"branch-alias": {
"dev-4.x": "4.x-dev"
},
"patches_applied": {
"3373921": "https://git.drupalcode.org/project/google_analytics/-/merge_requests/33.patch"
}
},
"installation-source": "dist",
......@@ -3711,8 +3714,8 @@
"homepage": "https://www.drupal.org/user/45640"
},
{
"name": "pfaocle",
"homepage": "https://www.drupal.org/user/9740"
"name": "mglaman",
"homepage": "https://www.drupal.org/user/2416470"
},
{
"name": "roberto.rivera.ixis",
......
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:
3373921
Source: https://git.drupalcode.org/project/google_analytics/-/merge_requests/33.patch
......@@ -5,20 +5,23 @@
* Installation file for Google Analytics module.
*/
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
use Drupal\user\Entity\Role;
/**
* Implements hook_install().
*/
function google_analytics_install() {
function google_analytics_install($is_syncing) {
// Make the default install more user and GDPR friendly.
$role = Role::load('authenticated');
$role->grantPermission('opt-in or out of google analytics tracking');
$success = $role->save();
if ($success) {
$messenger = \Drupal::messenger();
$messenger->addMessage(t('Module %module granted %permission permission to authenticated users.', ['%module' => 'Google Analytics', '%permission' => t('Opt-in or out of tracking')]), 'status');
if (!$is_syncing) {
$role = Role::load(AccountInterface::AUTHENTICATED_ROLE);
$role->grantPermission('opt-in or out of google analytics tracking');
$success = $role->save();
if ($success) {
$messenger = \Drupal::messenger();
$messenger->addMessage(t('Module %module granted %permission permission to authenticated users.', ['%module' => 'Google Analytics', '%permission' => t('Opt-in or out of tracking')]), 'status');
}
}
}
......
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