Problem with {exp:rating:form} {if duplicate} / url_title?
Posted: 16 April 2008 08:44 PM   [ Ignore ]
Newbie
Rank
Total Posts:  11
Joined  2008-02-06

With Rating 2.1.2 I’m having a problem with {exp:rating:form} and the {if duplicate} conditional when a single entry is identified by url_title in the request URI.

I have a template that displays a single entry, with a URL like this: http://example.com/template_group/template/url_title

It seems like Rating hangs you out to dry on the {if duplicate} conditional in this situation.  When I view an entry logged in as a user who has already rated that entry, {if duplicate} is behaving the opposite of how I expect.

So I took a look at the source code and I can see that Rating looks at a few different sources and puts the entry_id or url_title it finds into a variable called $entry_id.  When it does a query to answer “Are ratings allowed?”, it includes the appropriate WHERE clause depending on whether $entry_id is an entry_id or url_title.  But later when it does a query to answer “Has this user submitted already?”, it executes a query that assumes that $entry_id is really an entry_id.

Am I seeing that right or am I doing something wrong?

Profile
 
 
Posted: 17 April 2008 08:08 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  11
Joined  2008-02-06

Whoops—I guess I somehow managed to post this in the wrong forum.  Obviously this should be in the Rating forum.  Sorry about that.

Profile