GroupContentEnabler plugins are responsible for the automatic creation of GroupContentType entities. When a plugin is disabled on a GroupType, the GroupContent that had the associated GroupContentType as its bundle will become orphaned. This is bad :)

Tasks:

  • Disallow the uninstallation of a plugin from a GroupType when there is GroupContent using its GroupContentType
  • Disallow the uninstallation of modules providing plugins matching the above criteria

Tip: Create a service for the second task.

  group.uninstall_validator:
    class: Drupal\group\Extension\GroupContentUninstallValidator
    arguments: ['@plugin.manager.group_content_enabler', '@entity_type.manager', '@string_translation']
    lazy: true
    tags:
      - { name: module_install.uninstall_validator }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kristiaanvandeneynde created an issue. See original summary.

mike.davis’s picture

This patch provides the 'GroupContentUninstallValidator' class and updated service definition so that the Group Node module can not be uninstalled if there is node content on any of the groups.

mike.davis’s picture

Status: Active » Needs review

Updated status

kristiaanvandeneynde’s picture

Refactored it to work for all modules. Commit coming up.

kristiaanvandeneynde’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Status: Closed (fixed) » Needs work
kristiaanvandeneynde’s picture

Status: Needs work » Closed (fixed)

Bad testbot! :)