Drupal 11 Compatability for Delete All

Created on 22 April 2025, 4 days ago

Problem/Motivation

Update Delete All for use with Drupal 11

Steps to reproduce

Get 'Update Summary' to pass Delete All for Drupal 11,.

Proposed resolution

Drupal rector recommendations

1) web/modules/patched/delete_all/delete_all.module:0

---------- begin diff ----------
@@ @@
<?php

+use Drupal\Core\Routing\RouteMatchInterface;
+
/**
* @file
* Hooks & functions for delete_all module.
*/

-include_once drupal_get_path('module', 'delete_all') . '/includes/delete_all.content.batch.inc';
-include_once drupal_get_path('module', 'delete_all') . '/includes/delete_all.entities.batch.inc';
-include_once drupal_get_path('module', 'delete_all') . '/includes/delete_all.user.batch.inc';
+include_once \Drupal::service('extension.list.module')->getPath('delete_all') . '/includes/delete_all.content.batch.inc';
+include_once \Drupal::service('extension.list.module')->getPath('delete_all') . '/includes/delete_all.entities.batch.inc';
+include_once \Drupal::service('extension.list.module')->getPath('delete_all') . '/includes/delete_all.user.batch.inc';

/**
* Implements hook_help().
*/
-function delete_all_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_match)
+function delete_all_help($route_name, RouteMatchInterface $route_match)
{
switch ($route_name) {
// Main module help for the delete_all module.
----------- end diff -----------

Applied rules:
* ExtensionPathRector

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia interlated

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

Merge Requests

Comments & Activities

  • Issue created by @interlated
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan

    prem suthar โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !7added the D11 Compatability code. โ†’ (Open) created by prem suthar
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia interlated

    Needs more work. Got error 'PHP message: Drupal\\Core\\DependencyInjection\\ContainerNotInitializedException: \\Drupal::$container is not initialized yet. \\Drupal::setContainer() must be called with a real container. in /web/core/lib/Drupal.php on line 169 #0 /web/core/lib/Drupal.php(197): Drupal::getContainer()\n#1 /web/modules/patched/delete_all/delete_all.module(10): Drupal::service('extension.list....')\n#2 /1/web/core/lib/Drupal/Core/Hook/HookCollectorPass.php(184): include_once('...')\n#3 /web/core/lib/Drupal/Core/Hook/HookCollectorPass.php(147): Drupal\\Core\\Hook\\HookCollectorPass->collectModuleHookImplementations('modules/patched...', 'delete_all', '/^(?(...', false)\n#4/web/core/lib/Drupal/Core/Hook/HookCollectorPass.php(78): Drupal\\Core\\Hook\\HookCollectorPass::collectAll...'

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia interlated

    include_once __DIR__ . '/includes/delete_all.content.batch.inc';
    include_once __DIR__ . '/includes/delete_all.entities.batch.inc';
    include_once __DIR__ . '/includes/delete_all.user.batch.inc';

    Fixes it. Probably should be changed to be more OO?

Production build 0.71.5 2024