Closed (fixed)
Project:
Drupal core
Version:
8.3.x-dev
Component:
content_moderation.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Jan 2017 at 11:14 UTC
Updated:
10 Feb 2017 at 17:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
MaskyS commentedSince this is tagged as a Novice task, could you please specify the file(s) and the different chunks of code to be removed?
Comment #3
timmillwoodThe files in question are all of the ones in core/modules/content_moderation/src/Entity/Handler.
Each of the methods need to be checked to see if they're in use or not (maybe as simple as greping for them), and if they're not in use remove them.
Comment #4
alanhdev commentedStarting work on this now.
Comment #5
alanhdev commentedHaving worked through the methods in the files in question, there are none that are not obviously unused as they are called where the handler is dynamically set. E.g in EntityOperations.php entityPresave method:
$this->entityTypeManager->getHandler($entity->getEntityTypeId(), 'moderation')->onPresave(...
The onPresave method in the NodeModerationHandler is referred to in #2812811: Use EntityPublishedInterface during moderation of entities to add support beyond nodes and there is a patch on that issue which cleans up this method so maybe that should be handled there instead of on this issue.
Comment #6
alanhdev commentedRe-tagging with mssprintjan17
Comment #7
timmillwoodAlex mentioned in #2812811: Use EntityPublishedInterface during moderation of entities to add support beyond nodes that he can't see where
onBundleModerationConfigurationFormSubmitis used.If they are all used it might be worth documenting in the doc blocks how, why, and where they're used.
Comment #8
alanhdev commentedI've re-checked and that does appear to be unused. I'll remove it from ModerationHandler and ModerationHandlerInterface and create a patch.
Comment #9
alanhdev commentedPatch attached for removal of the unused code.
Comment #10
timmillwoodLooks good to me.
The
onBundleModerationConfigurationFormSubmitmethod isn't used anywhere, but all the other ones in the interface look as they're being used.Comment #11
alexpottYeah the call to this was removed by #2779647: Add a workflow component, ui module, and implement it in content moderation.
Committed 3bd9f36 and pushed to 8.3.x. Thanks!
Unused uses removed on commit. Things getting less entangled - nice.