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
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

LasseP - June 10, 2008 - 21:09
Assigned to:Anonymous» LasseP

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

LasseP - June 12, 2008 - 19:19
Category:bug report» task

Save the originial comment in the database and allow it to be used like other revisions.

#3

LasseP - June 13, 2008 - 13:24

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

maulwuff - June 13, 2008 - 15:43

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

LasseP - June 13, 2008 - 18:52

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

LasseP - June 13, 2008 - 18:55
Status:active» fixed

#7

Anonymous (not verified) - June 27, 2008 - 19:02
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.