You are here

uninstall-comment-module.sh in Realistic Dummy Content 7.2

#!/bin/bash
#
# Uninstall the comment module for Drupal 8
#

set -e

echo 'About to delete the comment module.'
echo 'Deleting all comment entity content...'
# We want to interpret $comment as a literal, not a variable.
# shellcheck disable=SC2016
drush ev 'foreach(entity_load_multiple("comment") as $comment) { $comment->delete(); }'
echo 'Deleting the comment storage...'
drush ev "\Drupal::entityManager()->getStorage('field_config')->load('node.article.comment')->delete();"
echo 'Run cron to avoid the fields pending deletion issue...'
drush cron
echo 'Uninstalling the comme module...'
drush -y pm-uninstall comment

File

developer/frameworks/drupal8/docker-resources/uninstall-comment-module.sh
View source
  1. #!/bin/bash
  2. #
  3. # Uninstall the comment module for Drupal 8
  4. #
  5. set -e
  6. echo 'About to delete the comment module.'
  7. echo 'Deleting all comment entity content...'
  8. # We want to interpret $comment as a literal, not a variable.
  9. # shellcheck disable=SC2016
  10. drush ev 'foreach(entity_load_multiple("comment") as $comment) { $comment->delete(); }'
  11. echo 'Deleting the comment storage...'
  12. drush ev "\Drupal::entityManager()->getStorage('field_config')->load('node.article.comment')->delete();"
  13. echo 'Run cron to avoid the fields pending deletion issue...'
  14. drush cron
  15. echo 'Uninstalling the comme module...'
  16. drush -y pm-uninstall comment