The book_copy_history table has a uid column but uid is never stored.

Comments

kleinmp’s picture

StatusFileSize
new1.26 KB

Here's a patch that stores the uid information. It also adds a nodeapi hook that removes items from the book_copy_history when the nodes are deleted.

jgraham’s picture

Status: Active » Needs work

I'll review the uid portion of the patch when I get a chance, but removing the history will not get committed;

Consider the following scenario;

Book A is copied to Book B
Book B is copied to Book C
Book C is copied to Book D
Book B is deleted

If we remove the referencing records from book_copy_history we have no way of telling that both Book C and Book D were at least partially derived from A. We had a use case where this information was requested. Showing the history tree we will see a "hole" where Book B was deleted, but the information is tracked so we know that Book A was the original source material for Book C and eventually Book D.

evoltech’s picture

There are a couple of issue with this patch.

1) It does not apply cleanly.

2) There is no uid in the {book_copy_history} table. Is it hoped that this column gets added?

3) It is unclear what exactly the compromise proposed by @jgraham is. Should it be assumed that you would like to add the tracking of uid, but not deleting of book_copy_history?

jgraham’s picture

The intent was to add the uid field to the table and the corresponding portion from the patch provided by kleinmp.

However the nodeapi portions of the patch are not to be commited as per the scenario described in my previous post.

evoltech’s picture

StatusFileSize
new2.18 KB

This patch makes the appropriate changes to book_copy.install to add the new uid field and handle upgrades for existing installations. It also includes the logic from @kleinmp's patch without the delete logic. This patch was made against book_copy-HEAD, it can be applied with:
cd book_copy-HEAD
patch -p0 < book_copy-435812.patch

jgraham’s picture

Status: Needs work » Fixed

committed thanks kleinmp and evoltech

Status: Fixed » Closed (fixed)

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