Install
Works with Drupal: ^8 || ^9 || ^10 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Automated Drupal 11 compatibility fixes for views_role_based_global_text
Dependency Injection Refactor (src/RoleBasedGlobalText.php)
- Added a proper __construct() and create() method to inject current_user and entity_type.manager services via the DI container.
- Replaced the deprecated \Drupal::currentUser() static call with the injected $this->currentUser service — fixing the deprecated code PHPCS issue.
- Replaced user_role_names() (deprecated function) with $this->entityTypeManager->getStorage('user_role')->loadMultiple() + Html::escape().
- Added imports for Html, EntityTypeManagerInterface, AccountInterface, RoleInterface, and ContainerInterface.
New Test Suite
- .gitlab-ci.yml — CI pipeline configuration added.
- tests/modules/views_role_based_global_text_test/ — new test helper submodule with a view fixture.
- tests/src/Functional/ViewsRoleBasedGlobalTextConfigurationTest.php — configuration form tests.
- tests/src/Functional/ViewsRoleBasedGlobalTextTestBase.php — base test class.
- tests/src/Functional/ViewsRoleBasedGlobalTextViewAccessTest.php — role-based access functional tests.