The installed "profile" content type is not removed at uninstall.

CommentFileSizeAuthor
#1 819782.patch579 bytesthreexk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

threexk’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Active » Needs review
FileSize
579 bytes
YK85’s picture

What if content type 'profile' is unchecked as a Content Profile, then the module is uninstalled?

threexk’s picture

I unchecked 'Use this content type as a content profile for users.' for the 'profile' content type, then uninstalled Content Profile, but the 'profile' content type remained.

The patch I submitted above will fix this by deleting the 'profile' content type in hook_uninstall().

YK85’s picture

I think it is a good idea to make the 'profile' content type no longer a content profile when Content Profile module is uninstalled, but -1 for deleting the 'profile' content type when uninstalling Content Profile module.

- what if the 'profile' content type already existed before the Content Profile module was installed. then after testing out Content Profile module and not liking it, uninstalling the module would delete the 'profile' content type?

- also, the 'use as content profile' for a content type is just a setting. I don't think uninstalling the module should delete a content type which Content Profile module doesn't handle.

- Would this patch delete already existing content?

Thanks!

threexk’s picture

Good points--simply deleting the content type could cause problems. I have two initial ideas:
1. Give the user a choice at uninstall to delete the 'profile' content type. Warn that all data belonging to it would be lost.
2. Change the name of the 'profile' content type to 'content_profile' or something else unique that's specific to Content Profile. This way there is no real chance of the content type preexisting. Then, when you uninstall, the 'content_profile' content type is deleted. It makes sense to delete it in this case, because the content type is explicitly for use as a content profile, and since after you uninstall you can't have content profiles, you won't need the content profile's data. This is like how CCK deletes content when you uninstall CCK.

I believe the Content Profile module has a duty to handle the 'profile' content type at uninstall since it creates it. If the user is expected to manually delete the 'profile' content type, wouldn't it be consistent and symmetric to expect the user to manually create a content type for use as a Content Profile, rather than having it automatically created? Content Profile's current behavior of leaving the 'profile' content type silently leaves changes to your system, and besides adding cruft to your system, these left-behinds can cause confusion and trouble for system administrators later. For example, a couple years later you notice this "profile" content type that you know nothing about. Where is it from? What does it do? Can you delete it or will it break something?

YK85’s picture

Hello,

Thanks for considering my concerns!

I like option (1) because as many of the urls used by this module are based off the content type name, by making Content Profile module make the generic content type 'content_profile' it would make it ugly and less adaptable to a wide audience of sites, forcing administrators to just create a content type called 'profile'. I like the idea of upon uninstalling giving the choice to either keep content type 'profile' on the system but no longer as a content profile type OR deleting the content type 'profile' all together.

fago’s picture

I'd be only ok with deleting the content type automatically, if there are no nodes configured for it. We should not destroy content.

YK85’s picture

I think deleting the content type automatically if no nodes are created for it sounds like a good idea! =)