Tried to uninstall webform 8.5-5.0-beta. Run drush pm-uninstall webform, seems I have to uninstall a couple of other webform module. I did as drush mentioned, webform_ui, webform_devel etc.

Finally I tried to disable webform, and got these:
exception 'Drupal\Core\Extension\ModuleUninstallValidatorException' with message 'The [error]
following reasons prevent the modules from being uninstalled: The class="placeholder">Webform field type is used in the following field: node.webform'
in /var/www/html/core/lib/Drupal/Core/Extension/ModuleInstaller.php:354
Stack trace:
#0 /var/www/html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(91):
Drupal\Core\Extension\ModuleInstaller->uninstall(Array, true)
#1 /opt/drush-8.x/vendor/drush/drush/commands/core/drupal/environment.inc(227):
Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall(Array)
#2 /opt/drush-8.x/vendor/drush/drush/commands/core/drupal/pm_8.inc(82):
drush_module_uninstall(Array)
#3 /opt/drush-8.x/vendor/drush/drush/commands/pm/pm.drush.inc(1237):
_drush_pm_uninstall(Array)
#4 [internal function]: drush_pm_uninstall('webform')
#5 /opt/drush-8.x/vendor/drush/drush/includes/command.inc(422):
call_user_func_array('drush_pm_uninst...', Array)
#6 /opt/drush-8.x/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array,
Array)
#7 [internal function]: drush_command('webform')
#8 /opt/drush-8.x/vendor/drush/drush/includes/command.inc(199):
call_user_func_array('drush_command', Array)
#9 /opt/drush-8.x/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#10 /opt/drush-8.x/vendor/drush/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#11 /opt/drush-8.x/vendor/drush/drush/drush.php(12): drush_main()
#12 {main}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yi_jiang created an issue. See original summary.

yi_jiang’s picture

Title: uninstall webform » Uninstall webform
jrockowitz’s picture

Status: Active » Closed (works as designed)

@yi_jiang This error is completely valid. You must delete all webform nodes and fields before uninstalling the Webform and Webform node module.

yi_jiang’s picture

I removed all webform node and webform, but still can not uninstall webform.

yi_jiang’s picture

Priority: Major » Minor
Status: Closed (works as designed) » Active

Can we leave it open since I actually deleted all the webforms before trying to un-install webform.

I know webform is pretty big project, however it should be able to open the option for people who want to disable the module.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)

Someone just needs to document the steps required to duplicate the issue using Simplytest.me and I will fix the problem.

MerryHamster’s picture

FileSize
49.39 KB

I have the similar problem when I try uninstall module, I see "The following reason prevents Webform from being uninstalled: Fields pending deletion"
As @jrockowitz tell I repeat my steps on Simplytest.me
version 8.x-5.0-beta12
- install empty project with Webform module
- enable Webform and Webform Node modules
- uninstall Webform Node
- and here - I can't uninstall Webform
uninstall webform

d2d’s picture

I spent a lot of time on this over the past few weeks. If you run CRON several times the Files Pending Deletion problem should go away.

The other thing that I found that was not obvious, at least to me, is that there is a Webform under Content Type as well as directly under Structure. You must delete this content type or at least the field in it to uninstall the Webform module.

grafikat’s picture

Has there been any movement on this? I have uninstalled, removed forms, removed content types and run cron 'til I'm blue in the face, but Drupal insists that it is still there.

jrockowitz’s picture

Someone needs to document the exact steps required to reproduce this issue via https://simplytest.me/project/webform.

Here are my steps attempting to reproduce this problem.

  • Create a clean install on simplytest.me (https://simplytest.me/project/webform)
  • Install the Webform and Webform Node module (/admin/modules)
  • Create a test webform submission (/webform/contact/test)
  • Create a Webform node using the Contact form (/node/add/webform)
  • Create a test webform node submission (/node/1/webform/test)
  • Confirm Webform can not be uninstalled (/admin/modules/uninstall)
  • Click link to remove all submission entities (/admin/modules/uninstall/entity/webform_submission)
  • Remove all submission entities
  • Delete webform node (/node/1/delete)
  • Confirm that Webfore module can not be uninstall and displays "Fields pending deletion" (/admin/modules/uninstall)
  • Run cron from the 'Status Report' (/admin/reports/status)
  • Uninstall the Webform module (/admin/modules/uninstall)
  • Check 'Status Report' (/admin/reports/status)
jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
davidalan31’s picture

@d2d Gave minor detail into what seems to be going on for some, including me. When attempting to uninstall the Webform module, the process eliminates the "body" field connected to the webform content type created by it, but does not delete the "webform" field (i.e. node.webform), leaving Drupal's config for the module in a mismatched state. The main webform module is looks at config and says that the field is still in existence, while the field is no longer attached to the node type that it was associated with, and can't be found to be deleted manually.

My fix for this issue was to reinstall the UI portions of the webform module, then go into the webform content type and delete the webform field. Next, I follow the steps of uninstalling the module again, and I am able to fully uninstall, without error. Hopefully this helps someone else.

vayu’s picture

I've deleted every thing I can find involving webform, its content, content types, modules, and it still won't let me delete it.

vayu’s picture

Finally got it. I had to restore a backup to get back to the properly installed webform. From there, I deleted all the content that had webforms/webform fields. Then I went to content types and deleted the fields within all the content types that were from webform. Then I deleted the whole content type. Then I went to structure/webform and deleted the fields one by one first, then I was able to uninstall webform.

It took a lot of time, it wasn't clear what had to be deleted and I lost content because I deleted the content types that had webform fields. It seems like there should be an easier delete. I'd love to help, but I don't know how to write modules and I'm under the gun timewise.

SKAUGHT’s picture

Status: Closed (cannot reproduce) » Needs work

re-opening. this is still a thing.

uninstall webform uI
uninstall webform node
'remove fields' (link in module desc)
uninstall webform

jrockowitz’s picture

Status: Needs work » Postponed (maintainer needs more info)

What is missing from the steps in #10 to reproduce this issue?

SKAUGHT’s picture

I've found this cause of the problem for the project i'm working on. I had a lack of information about the projects stories and current setup. Basically, the field_webform was added to another content type without clarification of use.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
SKAUGHT’s picture

rimibhagat’s picture

I too faced this problem with Uninstalling webform.
I resolved the issue by doing the following steps
1. I had to install/enable webform UI again.
2. Delete the Form field inside webform content-type.
3. Then deleteing all contents of webform type.
4. Uninstalling webform UI.
5. FInally unistalling Webform

punges24’s picture

I just tried to uninstall the module in drupal 8 and it completely crashed my system. Users can use the website, but I can not get into any of the admin functions at all or even try to edit a node, although other users can edit nodes still.

Does anyone have any advice what to do, without loosing information from today? My last backup was last night.