missing original version
maulwuff - May 12, 2008 - 14:48
| Project: | GB Comment Revisions |
| Version: | 5.x-0.1-beta1 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | LasseP |
| Status: | closed |
Jump to:
Description
if I create a comment, which says "original"
edit it, change text to "second",
edit it, change text to "third",
I'd expect havign a list of revisions with
third
second
original
But, "original" is not in that list. Is it lost?
The user has the permission "force revision", nothing else from that module.

#1
Got it.
Will work on that at the end of the week.
I've also set up a demonstration site for testing. http://sandbox.gooseberrycorps.com
#2
Save the originial comment in the database and allow it to be used like other revisions.
#3
Ok, at the moment, the module just creates a revision of a comment if it is edited, to save database space.
The problem is, the comment module saves the new information before the hook_comment is called.
That means, on "update" the edited comment is already in the {comments} database.
To get the values, the original comment need to be saved right after creation. And that would mean, that every comment is in the database two times.
Anyone got an idea how to prevent that?
#4
hmm, first I thought, what about hook_edit, but we are on comments here :)
what about hook_comment with $op ="form" ? we could save a copy to the rev table when the form is shown. Don't know if this makes sense.
#5
I tried all hook_comment operations, and i finaly choosed the "validation" operation.
This means, that if the validation fails, the original version gets saved, even if the comment is not updated, but if someone tries to send a comment, and it fails, he will possibly try it again. So this database space is not worthless.
Will commit the new features in a few minutes.
#6
#7
Automatically closed -- issue fixed for two weeks with no activity.