phase2/oa_core — pull request #65 by dsnopek (2014-07-16 16:44:03+00:00)
Title: EXPERIMENTAL: Archive child content when archiving a Space or Section?

Here is the problem: You archive a Space or Section, but it's child content remains accessible and not archived (which could appear bubbling up into a parent Space, via a link, whatever).

This PR will automatically archive the child content of a Space or Section, while still allowing a full round-trip, ie. if a child content item was already archived, and you archived the parent then unarchived it again, the child content item would still be archived. This all works great!

However, while testing it, I noticed some weirdness: combined with https://github.com/phase2/oa_core/pull/63, when viewing an archived Space or Section, it'll appear to have no content because all the archived content is hidden from widgets (per the widget configuration). :-/

@mike-potter: We should talk about this when you get back...

At the moment, I see two possible solutions:

1. Rather than archiving child content automatically, we could try and do some magic in the Views that would somehow check if the content being displayed was part of an archived parent. However, I'm really not sure how to do this in a performant/sane way, which is why I started down the current approach in the first place.

2. Keep the current approach, but come up with some way to dynamically update the widget settings to on an archived Space or Section to include archived content. This would have to not actually change the stored widget settings. I'm not exactly sure how to do this either (although, it seems simpler).

Anyway, just creating this PR to get my current code out there and start the discussion...