Problem/Motivation

UserBlock::getUserContentWorkflowCount uses the content_kanban.kanban_service service, which fails if the content_kanban module is disabled

Steps to reproduce

  1. Add the user block to your dashboard
  2. Disable the content_kanban module
  3. Visit the dashboard

Proposed resolution

Move KanbanService::getEntityIdsFromContentModerationEntities to a service in the content_planner module.

Comments

DieterHolvoet created an issue. See original summary.

ruturaj chaubey’s picture

Assigned: Unassigned » ruturaj chaubey
ruturaj chaubey’s picture

Assigned: ruturaj chaubey » Unassigned
StatusFileSize
new5.76 KB

Moved the KanbanService::getEntityIdsFromContentModerationEntities to a service in content_planner module.
This is the patch.

ruturaj chaubey’s picture

Status: Active » Needs review
dieterholvoet’s picture

Status: Needs review » Needs work
  • The new service doesn't have to be called DashboardKanbanService, the methods are not kanban related. I think something like ContentModerationService would be better.
  • The old methods should be removed and any old usages should change to the new service (eg. KanbanFilterForm)
  • watchdog_exception('content_kanban', $e); should be changed to watchdog_exception('content_planner', $e);
  • The StringTranslationTrait related changes don't belong in this issue
ruturaj chaubey’s picture

Can you provide a little more clarity regarding the second point ?

dieterholvoet’s picture

You should move the methods, not just copy them. Any other places using the method you moved should use the new service instead of the old one.

ruturaj chaubey’s picture

Assigned: Unassigned » ruturaj chaubey
ruturaj chaubey’s picture

Made the following changes in the patch kanban-service-to-content-planner-3271149-9.patch:

  • Renamed the service from DashboardKanbanService to ContentModerationService.
  • Removed the old methods from KanbanService and changed the old usages to the new service in KanbanFilterForm.
  • watchdog_exception('content_kanban', $e); changed to watchdog_exception('content_planner', $e);
  • The StringTranslationTrait related changes removed.
ruturaj chaubey’s picture

Assigned: ruturaj chaubey » Unassigned
Status: Needs work » Needs review
dieterholvoet’s picture

Status: Needs review » Reviewed & tested by the community

Works great! Thanks for the help.

dieterholvoet’s picture

The last patch was deleting a file that didn't exist.

dieterholvoet’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.