This is great! I have been looking for such a module for a loooong time! I could do it myself with the existing CCK means but I couldn't find an easy way to enforce referential integrity between the Gallery and Image content types. My question is: does this module take care of referential integrity? What happens if a user tries to delete a gallery, which has images in it:
a) Is the user allowed to do so or...
b) The images are automatically deleted with the parent gallery or...
c) The images are left orphaned?

Thanks!

Comments

greg.harvey’s picture

Title: How is the referential integrity handled? » Allow admin to choose how deleted gallery content is handled by default
Assigned: Unassigned » greg.harvey

Hi,

At the moment the user is offered a choice when they delete a gallery (there is an additional checkbox that says "Delete all images in this gallery?") - if they choose to keep the images, they are orphaned, but the next time they are edited the user is obliged to select a new gallery (or galleries) for them. But I'm happy to add an admin interface to choose between any of these options:

When a gallery is deleted:

[radio buttons]
* Delete images
* Offer user the choice
* Orphan images

Note, the current behaviour does not allow users to delete their last gallery. If they are down to their last gallery and try to delete it then they will not be permitted, so there is *always* at least one gallery to choose from. This is down to the gallery being a required field on the image content type.

I'm toying with making this optional too.

kirilius’s picture

Excellent! Thanks!

greg.harvey’s picture

Status: Active » Fixed

Done, will be in next snapshot.

Status: Fixed » Closed (fixed)

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