Deprecated system_get_module_admin_tasks in drupal:10.2.0 and is removed from drupal:11.0.0

Created on 3 January 2024, 11 months ago
Updated 5 June 2024, 6 months ago

Problem/Motivation

EDIT: The error below has been fixed in ๐Ÿ› Fix fatal 'TypeError: ModulePermissionsLinkHelper::getModulePermissionsLink(): Argument #2 ($name) must be of type string, array given' Fixed :

TypeError: Drupal\user\ModulePermissionsLinkHelper::getModulePermissionsLink(): Argument #2 ($name) must be of type string, array given, called in /docroot/core/modules/system/system.module on line 992 in Drupal\user\ModulePermissionsLinkHelper->getModulePermissionsLink() (line 47 of core/modules/user/src/ModulePermissionsLinkHelper.php).
system_get_module_admin_tasks('block_class', Array) (Line: 95)
Drupal\block_class\Controller\BlockClassController->index()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

AND

 * @deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use the
 *   'system.module_admin_links_helper' service with the getModuleAdminLinks() method
 *   and 'user.module_permissions_link_helper' service with the
 *   ::getModulePermissionsLink() method instead.

Steps to reproduce

navigate to /admin/block-class/help

Proposed resolution

Using this code instead

    $info = $this->extensionListModule->getExtensionInfo($projectMachineName);

    $adminTasks = \Drupal::service('system.module_admin_links_helper')->getModuleAdminLinks($projectMachineName);
    if ($perms_link = \Drupal::service('user.module_permissions_link_helper')->getModulePermissionsLink($projectMachineName, $info['name'])) {
      $adminTasks["user.admin_permissions.{$projectMachineName}"] = $perms_link;
    }
๐Ÿ“Œ Task
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡ฏ๐Ÿ‡ดJordan Ahmad Khader

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024