Data synchronization book.module when outline.module is enabled.
beginner - September 30, 2008 - 07:47
| Project: | Outline |
| Version: | 6.x-0.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | beginner |
| Status: | active |
Description
When enabling the module on a clean D6 site which already has plenty of book pages in the book outline {book},
such nodes will not be populated in my {outline_*} tables. Code the module so that it can cope with missing data, and add them as we go along and customize the settings of such nodes.
i.e. improve the code in nodeapi / update, to check for missing data, and do an insert instead of an update.

#1
There are two ways to go about it:
1) either we initialize all existing book nodes to work with outline.module when the latter is initialized.
2) or we do nothing but we initialize each node separately as we go along.
solution 1 would make more sense, I think.
Next question: what needs to be initialized?
#2
Looking at the {outline_book} columns, I'm thinking we should update the table definition to create default values for some of them.
#3
Here is a very beginning of a patch. It's not complete, but I don't have time to play more today.
#4
committed full fix today.
#5
The last patch didn't account for the following scenario:
install outline -> disable outline -> use book.module some more -> re-enable outline.
#6
http://api.drupal.org/api/function/hook_enable/6
#7
Done:
Import data from book.module where we don't have a corresponding outline entry:
TODO:
Update data where the vid, the place in the outline has changed, where nodes have been removed, etc...