Avoid static class call of ActivityCreatorBatchActivityDeletion

Created on 14 April 2025, 23 days ago

Problem/Motivation

The activity_creator.batch_activity_deletion service defined in the activity_creator module cannot be properly overridden due to a hardcoded static class call within the module.

In activity_creator.module, the function _activity_creator_activity_for_entity_updater() directly calls:

ActivityCreatorBatchActivityDeletion::bulkDeleteActivities($ids);

This bypasses the service container entirely and prevents any custom implementation from being injected.

Proposed resolution

Replace the static class call in _activity_creator_activity_for_entity_updater() with a dynamic service call from the service container:

Before:
ActivityCreatorBatchActivityDeletion::bulkDeleteActivities($ids);

After:
\Drupal::service('activity_creator.batch_activity_deletion')->bulkDeleteActivities($ids);

📌 Task
Status

Active

Version

12.1

Component

Code (back-end)

Created by

🇩🇪Germany Duwid

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

Comments & Activities

Production build 0.71.5 2024