Skip to content
Snippets Groups Projects
Commit dbb2e14a authored by Joseph Olstad's avatar Joseph Olstad
Browse files

Issue #3482803 by joseph.olstad: Automated Drupal 11 compatibility fixes for adobe_analytics

parent bf6a694c
Branches 8.x-1.x
Tags 8.x-1.0
No related merge requests found
name: Adobe Analytics
description: "Adds Adobe Analytics javascript tracking code to your site's pages."
type: module
core_version_requirement: ^9 || ^10
core_version_requirement: ^10 || ^11
configure: adobe_analytics.settings
dependencies:
- field
......
......@@ -2,6 +2,7 @@
namespace Drupal\adobe_analytics\Form;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
......@@ -10,6 +11,32 @@ use Drupal\Core\Form\FormStateInterface;
*/
class AdobeAnalyticsAdminSettings extends ConfigFormBase {
/**
* The entity type manager service.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Constructs an ExampleConfigForm object.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager service.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public static function create($container) {
return new static(
$container->get('entity_type.manager')
);
}
/**
* {@inheritdoc}
*/
......@@ -93,7 +120,7 @@ class AdobeAnalyticsAdminSettings extends ConfigFormBase {
];
$roles = [];
foreach (user_roles() as $role) {
foreach ($this->entityTypeManager->getStorage('user_role')->loadMultiple() as $role) {
$roles[$role->id()] = $role->label();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment