Skeleton needs to be able to allow skeleton administrators to add new templates to a skeleton, and then push them out to instantiated outlines. As well, if a template is removed from a skeleton, and it hasn't been changed, it should be able to be removed as well. As is, I see a few things needed to reach this goal:
- When a skeleton is created, an instance needs to have recorded what skeleton ID it came from.
- Each template instance needs to be able to store if it's been changed from the base template or not. This could be as simple as comparing to the stored template by ID, or by storing a flag which is switched the first time a node is re-saved.
- There should be a list of instances, along with notes as to if an instance or specific template has been changed. It needs to be easy for users to determine if a outline instance has been changed.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 351884_add_to_instances_9.patch | 27.88 KB | deviantintegral |
| #8 | 351884_add_to_instances_8.patch | 27.88 KB | deviantintegral |
| #7 | 351884_add_to_instances_7.patch | 26.99 KB | deviantintegral |
| #3 | 351884_add_to_instances_3.patch | 23.55 KB | deviantintegral |
| #2 | 351884_add_to_instances_2.patch | 23.41 KB | deviantintegral |
Comments
Comment #1
deviantintegral commentedHere is an incomplete patch which starts to implement this. It adds a new database table to store nid's link to template ID's. On the first save of the node, it plays it safe and removes the link, as we may not always be able to tell if content has changed.
This will still need some work.
Comment #2
deviantintegral commentedHere is a patch which implements the following features:
Some functions had to be moved around (notably hook_form_alter()) so that it could be accessed in more than one case.
Comment #3
deviantintegral commentedUpdated to not unset node ownership.
Comment #4
agentrickardI am not sure I agree with this feature. Can the created instance opt-out of these updates? I suppose I would implement this as a batch operation, similar to admin/content/list and hook_node_operations(). Allow the editor to select which instances to update.
Comment #5
deviantintegral commentedI really like the idea of using the batch API; that will also ensure that the operation doesn't time out on slower sites. Opt-out could also be useful.
I'm going to re-approach this as more of a "sync" feature versus automatically doing it when saving a template. Since the information will be recorded, it should be possible to have a "Synchronize content" tab which allows editors to apply updates as needed.
Comment #6
agentrickardYeah ++ for 'sync'
I can help with the batch stuff, if need be. The documentation has a few errors.
Comment #7
deviantintegral commentedHere is a reworked patch which adds a "Synchronize" tab and uses the batch API. For anyone testing, it will only work for newly created nodes so the table can get populated properly.
For now, it only deals with templates which have been modified. I'd like to keep this issue just to that function, but so far it's been designed so that adding other functions shouldn't be too difficult.
Comment #8
deviantintegral commentedI realized that in order to properly manage adding and removing templates, the skeleton ID needs to be recorded as well. This update adds a column to the table (though it won't be used in this patch).
Comment #9
deviantintegral commentedReroll against HEAD.
Comment #10
deviantintegral commentedI've committed this to HEAD.