module uninstall functionality

Created on 28 October 2024, 18 days ago

Hi all! When this module is uninstalled all trashed items lose their trashed status and appear on the website as they were originally. What are the thoughts on maybe having a hook_uninstall that, at the minimum, unpublishes any items that were in the trash at the time of uninstall? This would at least keep those items from being back in public view.

πŸ’¬ Support request
Status

Active

Version

3.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States jackfoust

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jackfoust
  • πŸ‡·πŸ‡΄Romania amateescu

    That's a very interesting problem to uncover!

    I agree that uninstalling this module can be a "dangerous" operation, but sadly a hook_uninstall() implementation that would unpublish the deleted content is not feasible because there could hundreds or thousands of items in the trash, and the uninstall operation would just time out and leave the site in an inconsistent state.

    I think a reasonable approach would be to *prevent* the module from being uninstalled if there is content in trash, and ask the user to either restore or purge that content before being able to uninstall it.

  • πŸ‡ΊπŸ‡ΈUnited States jackfoust

    Good point on the overhead of possibly having too items to modify on hook_uninstall. The alternate makes great sense, and now that I think about it is in use in a lot of other modules.

Production build 0.71.5 2024