Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Review votes after edit???

Quote Reply
Review votes after edit???
This may have been discussed before, but I couldn't find it...

It looks like when a review is edited, the votes for that review are cleared to 0 (Review_Was_Helpful and Review_Was_Not_Helpful). I tried to pass the existing votes over by editing the review_edit.html template and adding the following to the form:

Code:
<input type="hidden" name="Review_Was_Helpful" value=<%if Review_WasHelpful%><%Review_WasHelpful%><%else%>0<%endif%>>
<input type="hidden" name="Review_Was_Not_Helpful" value=<%if Review_WasNotHelpful%><%Review_WasNotHelpful%><%else%>0<%endif%>>

however... it still resets the votes to 0. Has anyone experienced this?

Sean
Quote Reply
Re: [SeanP] Review votes after edit??? In reply to
Hi Sean,

Yes I found this was a problem as well:

http://www.gossamer-threads.com/...orum.cgi?post=206374

I can't see an easy way to fix it without editing Review.pm.

Laura.
The UK High Street
Quote Reply
Re: [afinlr] Review votes after edit??? In reply to
Hi,

The helpful numbers are removed by design as it's a changed review, so previous helpful ratings no longer apply. How would you like to see it changed? Do you want it more like the forum (with an edit notice displayed at the bottom), or perhaps remove the ability to edit reviews? Or just allow edits to go through without affecting the other fields?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Review votes after edit??? In reply to
Here's the message I sent to support:

Quote:
Thanks. I think you're correct in the fact that if someone changes a review, then the votes for that review would be irrelevant. However, what it is doing now, is resetting the votes, but not allowing me to vote again after the review is edited and the counts are reset. If I have voted yes or no for the review, then it is edited and there are no votes, it tells me I have already voted and doesn't allow me to continue. Where does it keep that info? I don't really mind that it resets, but it should allow people to revote.

Sean

Here's the fix I received:

Quote:
Hi Sean,

We will add this fix into next release. Please folow these steps below as a quick solution:

- Under the lines (around line 428 in Review.pm):
# Update the record.
$db->update($input,{ ReviewID => $input->{ReviewID}}) or return { error => $GT::SQL::error};

- Add new lines:
# Delete the review track from this ReviewID
my $click_db = $DB->table ('ClickTrack');
$click_db->delete({ReviewID => $input->{ReviewID}, ClickType => 'Review'}) or return { error => $GT::SQL::error};

Cheers,
Jean
Gossamer Threads Inc.

It's now working how I want it to work. That was my main concern, was that after a review was changed, the votes were cleared, but you couldn't revote. If it was going to hold onto who voted, then the votes shouldn't reset. However, if the votes reset, it should reset who voted. I see the point made that if a review is changed, all of the content in that review may be different and the votes shouldn't count.

Sean
Quote Reply
Re: [Alex] Review votes after edit??? In reply to
Alex,

I think its extremely useful that people can edit their reviews. However, in my case I don't want the helpfulness ratings reset because generally I have found that people who edit their reviews do not make dramatic changes (on my site). Also, I didn't want the edited reviews to be flagged as new and put to the top of the list so I have added a mod_date field and an extra line to say when the review was edited.

Laura.
The UK High Street
Quote Reply
Re: [afinlr] Review votes after edit??? In reply to
To keep it from resetting the votes, I received this from support:

Quote:
We've had a discussion about this issue before. Logically, if users edit
their review content, we should reset the vote for Review_Was_Helpful
to zero.

If you want to carry over the votes when a user update his/her review,
just simply comment out (or get rid of them) the lines below (around
line 408, the sub _update_this_review) in the file
admin/Links/User/Review.pm

# Reset some vars
$input->{Review_WasHelpful} = 0 ;
$input->{Review_WasNotHelpful} = 0 ;

I haven't tried it, but hopefully, that's all you need...

Sean
Quote Reply
Re: [SeanP] Review votes after edit??? In reply to
Thanks Sean, that's exactly what I did. I was really just replying to Alex as he seemed to be asking for input as to what people wanted from the review system but it would probably have been more helpful to others if I had explained what I did.

So I'll try to explain the mod to get the modified_date in the database:

1. Add an extra field to your Reviews table called Review_ModDate

2. In the _update_this_review sub in Review.pm change this bit

# Set date review to today's date.
Links::init_date();
##Change this
$input->{Review_ModDate} = GT::Date::date_get();

3. A bit further down change this

# Format the date for sending email
#Change this
$input->{Review_Date} = GT::Date::date_transform($input->{Review_ModDate},$CFG->{date_db_format},$CFG->{date_user_format});

4. Add a line to your review template

<%if Review_ModDate >0%>This review was edited on <%GT::Date::date_transform($Review_ModDate,'%yyyy%-%mm%-%dd%', '%dddd%, %dd% %mmm% %yyyy%')%> by <%Review_Owner%>.<%endif%>

I think that's it.

Laura.
The UK High Street