Skip to content

Commit

Permalink
Test matomo patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
rosiel committed Jul 21, 2023
1 parent 2297bfb commit 4c4acc7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
16 changes: 16 additions & 0 deletions assets/patches/matomo-3363521-8.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/matomo.install b/matomo.install
index 021b86b..c557546 100644
--- a/matomo.install
+++ b/matomo.install
@@ -15,8 +15,9 @@ use Drupal\user\Entity\Role;
*/
function matomo_install(): void {
// Make the default install more user and GDPR friendly.
- $role = Role::load('authenticated');
- $role->grantPermission('opt-in or out of matomo tracking');
+ user_role_grant_permissions(AccountInterface::AUTHENTICATED_ROLE, [
+ 'opt-in or out of matomo tracking',
+ ]);
$success = $role->save();
if ($success) {
$messenger = \Drupal::messenger();
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@
"type:drupal-custom-theme"
]
},
"patches": {}
"patches": {
"drupal/matomo": {
"Allow install from existing config": "assets/patches/matomo-3363521-8.patch"
}
}
},
"scripts": {
"post-root-package-install": ["Islandora\\StarterSite::rootPackageInstall"]
Expand Down

0 comments on commit 4c4acc7

Please sign in to comment.