content_moderation.install 825 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the Content Moderation module.
  5. */
  6. /**
  7. * Implements hook_requirements().
  8. */
  9. function content_moderation_requirements($phase) {
  10. $requirements = [];
  11. if ($phase === 'install' && \Drupal::moduleHandler()->moduleExists('workspaces')) {
  12. $requirements['workspaces_incompatibility'] = [
  13. 'severity' => REQUIREMENT_ERROR,
  14. 'description' => t('Content Moderation can not be installed when Workspaces is also installed.'),
  15. ];
  16. }
  17. return $requirements;
  18. }
  19. /**
  20. * Remove the 'content_revision_tracker' table.
  21. */
  22. function content_moderation_update_8401() {
  23. $database_schema = \Drupal::database()->schema();
  24. if ($database_schema->tableExists('content_revision_tracker')) {
  25. $database_schema->dropTable('content_revision_tracker');
  26. }
  27. }