After I discovered the advertisement for users, I decided not to use Disquss and delete the module.
But to my surprise, deleting the module is inactive, although for all materials I deleted the Disquss fields.
http://prntscr.com/ktqca1
How do I remove a module from the site?

Comments

fomenkoandrey created an issue. See original summary.

gaurav.kapoor’s picture

Status: Active » Closed (outdated)
bburg’s picture

Status: Closed (outdated) » Active

This is still a valid question. There doesn't appear to be any valid way to uninstall this module once it's installed.

bburg’s picture

So you will need to delete any Disqus fields you've created on any entities. You should be able to do this in the UI, clear cache, and then uninstall the module.

Here's a scripted version though:

/**
 * Delete the blog_comment Disqus field so we can uninstall the module.
 */
function my_module_update_80XX() {
  // Deleting field storage.
  $fieldStorageConfig = FieldStorageConfig::loadByName('node', 'field_comment');
  if ($fieldStorageConfig) {
    $fieldStorageConfig->delete();
  }
  $fieldConfig = FieldConfig::loadByName('node', 'blog', 'field_comment');
  if ($fieldConfig) {
    $fieldConfig->delete();
  }
  field_purge_batch(100);
  \Drupal::service('module_installer')->uninstall([
    'disqus',
  ]);
}

gaurav.kapoor’s picture

@bburg Thanks for providing the solution. This is the case with all the modules which provide fields or entities. They have to deleted otherwise module doesn't allow uninstall.

gaurav.kapoor’s picture

Version: 8.x-1.x-dev » 2.0.x-dev