Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I want to deinstall worbench modul I see following message on deinstall page at modul information and so i am unable to check deinstall checkbox:
There is data for the field moderation_state on entity type Content
This is also if I disable workbench moderation on every content type I uses workbench moderation.
Only removing every content i created using the modul helped. This is not really usefull despite I can disable workbench moderation ...
Comment | File | Size | Author |
---|---|---|---|
#19 | 2762777-19-facilitate-uninstall.patch | 3.06 KB | jacobbell84 |
#17 | 2762777-15-facilitate-uninstall.patch | 2.99 KB | yuehua |
#15 | 2762777-15-facilitate-uninstall.patch | 2.16 KB | jigarius |
Comments
Comment #2
ArtuDrop CreditAttribution: ArtuDrop commentedNeither can I.
Comment #3
timmillwoodSorry, this will never be fixed in the contrib module.
Content Moderation in core has fixed this issue.
Comment #4
ArtuDrop CreditAttribution: ArtuDrop commentedTim, please explain how to fix it (uninstall the module) though anyway.
Comment #5
timmillwoodI've not tried, but I expect if you delete all your content you should be able to uninstall it.
Comment #6
MartinMa CreditAttribution: MartinMa as a volunteer commentedI just have this problem too. Removing all content is not an solution for an existing site. Could be the deploy module a solution to put the content to a clean new installation?
Comment #7
captaindav CreditAttribution: captaindav commentedI have this issue too, I would think many others as well will face this as they upgrade to the newer versions of Drupal Core that has Content Moderation. As a work-around, is it possible to install the Drupal Core Content Moderation module and leave Workbench Moderation installed as well?
Comment #8
timmillwoodThis is fixed in 8.5.x
See https://www.drupal.org/node/2907785
Comment #9
captaindav CreditAttribution: captaindav commentedI have a Lightning based site on 8.4 site going live next week that has workbench installed. Any idea of a work-around to use the Core Workflow/CM modules until 8.5 is released?
Comment #10
diamondseaIf you are still pre-8.5+ you can use a script like this to remove data so you can uninstall the module.
You might need to add or remove a few lines depending on the modules you have installed.
Comment #11
jigariusSince many people will want to uninstall this module, it will be great if someone could create a drush command and put it in the module itself? Or maybe implement a hook in the workbench_moderation module to help ease the process? I'll give it a try if I have time.
Comment #12
jigariusComment #13
jigariusI see that it's been marked as won't fix. Sorry to reopen this issue, but I came up with a patch for this which might be worth taking a look at? I've implemented a hook_uninstall() which clears the moderation_state field, resulting in a clean uninstall of the workbench_moderation module.
Although a kind-of-a-solution has been provided in comment 5, but it is not very practical to delete the entire site's content to be able to uninstall a module. Hence, it will be good to include this patch cause most people will want to uninstall this module and run into this problem.
If you're planning to use this patch, make sure you test it on a dev env. All you have to do is apply the patch and then run
drush pmu -y
.Comment #14
jigariusForgot to mark as "needs review". Please see comment 13.
Comment #15
jigariusThe previous patch works, however, I think there's room for a minor improvement.
Comment #16
sharif.elshobkshy CreditAttribution: sharif.elshobkshy as a volunteer commentedSolved by adding a hook_update that adds the missing fields/columns.
After running the update, I'm able to disable the "Workbench Moderation".
hook_update:
Note: The above tables were blocking me when trying to disable the module. It could happen that you need to add less/more tables in your code.
Hope this helps.
Regards.
Comment #17
yuehua CreditAttribution: yuehua commentedThanks for the suggestion on the #16. I rebuild the patch based on this suggestion.
Comment #18
kiwad CreditAttribution: kiwad commentedWhat a good timing for that patch :)
Taking over a project from which we want to remove workbench
Applied patch and got : workbench_moderation was successfully uninstalled.
Comment #19
jacobbell84 CreditAttribution: jacobbell84 at ZenSource commentedThanks for this! This saved me a bunch of time. I added two additional tables the original patch wasn't accounting for (menu_link_content_data which is added by the Menu Item Extras module and paragraphs_library_item_field_data which is added by the Paragraph Library module).