-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use Drupal 10. * Test only on PHP 8.1. * Matomo patch. * Update openseadragon. * PHP 8.2. * Use drupal namespace for islandora modules.
- Loading branch information
Showing
4 changed files
with
2,478 additions
and
2,378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
From da80d90705ca385addf6e68d16459d6433a2b8b0 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Ignacio=20D=C3=ADaz-Roncero?= | ||
<[email protected]> | ||
Date: Tue, 30 May 2023 10:49:24 +0000 | ||
Subject: [PATCH] Add check for Role | ||
|
||
--- | ||
matomo.install | 19 +++++++++++-------- | ||
1 file changed, 11 insertions(+), 8 deletions(-) | ||
|
||
diff --git a/matomo.install b/matomo.install | ||
index 021b86b..a2ef178 100644 | ||
--- a/matomo.install | ||
+++ b/matomo.install | ||
@@ -9,6 +9,7 @@ declare(strict_types = 1); | ||
|
||
use Drupal\Core\Url; | ||
use Drupal\user\Entity\Role; | ||
+use Drupal\user\RoleInterface; | ||
|
||
/** | ||
* Implements hook_install(). | ||
@@ -16,14 +17,16 @@ 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'); | ||
- $success = $role->save(); | ||
- if ($success) { | ||
- $messenger = \Drupal::messenger(); | ||
- $messenger->addMessage(t('Module %module granted %permission permission to authenticated users.', [ | ||
- '%module' => 'Matomo Analytics', | ||
- '%permission' => t('Opt-in or out of tracking'), | ||
- ]), 'status'); | ||
+ if ($role instanceof RoleInterface) { | ||
+ $role->grantPermission('opt-in or out of matomo tracking'); | ||
+ $success = $role->save(); | ||
+ if ($success) { | ||
+ $messenger = \Drupal::messenger(); | ||
+ $messenger->addMessage(t('Module %module granted %permission permission to authenticated users.', [ | ||
+ '%module' => 'Matomo Analytics', | ||
+ '%permission' => t('Opt-in or out of tracking'), | ||
+ ]), 'status'); | ||
+ } | ||
} | ||
|
||
if (\Drupal::moduleHandler()->moduleExists('views')) { | ||
-- | ||
GitLab | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.