First drupal bug report so I apologize if I am doing it wrong.

I tried this with a thumbs up widget and a number-up-down widget.

With either of them, when I vote, I see the word "saving vote..." and then the widget and the vote counter disappears. (ex: for the thumbs up widget the thumb and the "x many votes")

When I reload the node the widget is back but the counter has not changed.

I tried this as admin, auth user and anonymous, same result.

I am using the default options for the rate and voting api modules.

This module looks great, and I hope I end up getting to use it.

CommentFileSizeAuthor
#18 issue.png31.17 KBcharubachi

Comments

schaeferwebsolutions’s picture

Component: User interface » Code

Looked at other bugs and 'Code' component seems more appropriate.

mauritsl’s picture

Seems like there is some error with the AJAX call. Can you check for JavaScript errors in the error console? And also check for errors in admin/reports/dblog.

You may also try to copy the link from the rate button (thumb or so) and open that link in a new tab. That way you bypass the AJAX call and use the fallback instead. If that doesn't work either then it will be a server-side issue.

schaeferwebsolutions’s picture

--
[14:54:59.241] Use of Mutation Events is deprecated. Use MutationObserver instead. @ chrome://firebug/content/chrome/tabContext.js:589
thats all i get from the error console, not sure if it is relevant

below is the first error(chronologically) from dblog. There were others, but I think this is the relevant one.
Notice: Undefined index: content_type in rate_vote_ahah() (line 764 .... of rate/rate.module).

Other errors:
undefined index: content_id
widget_id
widget_mode

then:
Notice: Undefined offset: 0 in rate_vote_ahah() (line 770
Notice: Trying to get property of non-object in rate_vote_ahah() (line 773
Warning: Invalid argument supplied for foreach() in rate_vote_ahah() (line 773

Running the link by itself worked great.... I'm still trying to figure out how I broke this thing.

schaeferwebsolutions’s picture

I typed up this whole thing and it didnt save!!! edit:(apparently it did save. That was kinda strange.)

anyway...

error console only gave me
[15:02:53.114] Use of Mutation Events is deprecated. Use MutationObserver instead. @ chrome://firebug/content/chrome/tabContext.js:589
not sure if this is relevant

checked dblog and it had a number of errors:

Notice: Undefined index: content_type in rate_vote_ahah() (line 764 in rate.module
more undefined indexes: content_id, widget_id, widget_mode
Notice: Undefined offset: 0 in rate_vote_ahah() (line 770
Notice: Trying to get property of non-object in rate_vote_ahah() (line 773
Warning: Invalid argument supplied for foreach() in rate_vote_ahah() (line 773

running the link by itself works great, button updates with a new vote and doesn't disappear .... still trying to figure out how I broke this thing.

Tsuvian’s picture

I'm experiencing the same problem, fresh install of Drupal 7 and Rate, same errors using either the stable or dev release.

Edit: Reverted to 1.3, everything seems to work fine with the previous version.

schaeferwebsolutions’s picture

I also tried going back to 1.3 and it worked.

It seems like this shouldn't be marked closed as it is still an issue for 1.4
...not sure how to mark this so just leaving it as is.

mauritsl’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not yet able to reproduce this (Chrome / OS-X). The error looks like it is missing the classes from the rate widget (the token and content type are fetched from there). But since you are talking about a fresh install I suppose you didn't change the template (and class should thus remain intact).

Could this be related to this? I do not not how this could be related, but this issue is the cause of more troubles which didn't exists in 1.3.
http://drupal.org/node/1825848

aardvark92’s picture

I'm having the same problem in versions 1.4 and 1.5. Version 1.3 works. I'm investigating and will give more details as I find them.

schaeferwebsolutions’s picture

Sorry for the delay, I'm using 1.3 just fine now. That issue with jquery.js being called first doesnt seem relevent to what my issue was. Sorry I don't have any more info for you.

aardvark92’s picture

Version: 7.x-1.5 » 7.x-1.4

OK, I think I've narrowed down the source of the problem, and it does look like it's somehow related to the other issue.

First, the issue appears to be browser independent: I've tried it with Chrome, Opera, and Firefox, all on both Linux and Windows. It works everywhere with Rate 1.3, but the widget disappears with Rate 1.4 and the vote is not recorded. (Not sure why OS X Chrome behaves differently.) I've tried it as an anonymous user, logged in user, and admin, and the same thing happens for each.

Also, in case this matters, I'm using the thumbs up/thumbs down widget.

I made a copy of my site, with Rate 1.3, and verified everything still worked. I then upgraded to 1.4, and got the problem with the disappearing widget.

Next I replaced rate.js on the copy site with the version 1.3 rate.js. Still got the problem. Upgraded back to rate.js 1.4, and replaced rate.module with version 1.3. Votes were recorded correctly. The page reloaded (so it's not using Ajax) and the widget reappeared with the new vote percentages.

I then made a diff of rate.module 1.3 and 1.4, and started upgrading it one function at a time. (This probably left it unstable at times, but it gave me the source of the problem). The voting worked until I got to the section labeled // Add generic javascript. (Line 271 in v 1.3 and lines 285-292 in v 1.4). With the 1.4 code for this section, the votes were no longer recorded and the widget disappeared.

Finally, I upgraded back to rate.module 1.4, commented out this section and replaced it with the 1.3 code. Now every vote gives me an error message:

Notice: Undefined property: stdClass::$delete_vote_on_second_click in rate_rate_vote_alter() (line 647 of /var/www/html/bookcopy/sites/all/modules/rate/rate.module).

(I knew I was going to break something doing this)...but the vote is recorded, the page reloads, and the widget shows the new percentages.

Hope this helps.

aardvark92’s picture

Version: 7.x-1.4 » 7.x-1.5

I upgraded to v 1.5, replaced the same section with the 1.3 code, and got the same error message (line 659 instead of 647) but otherwise everything worked.

mwidner’s picture

Version: 7.x-1.4 » 7.x-1.5

I can confirm this problem on a clean install of Drupal 7.17 and Rate 7.x-1.5.

mauritsl’s picture

Fix is committed to GIT, see #1843238: Ajax path bug in rate.js.

mauritsl’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Fix is in release 1.6. Please upgrade to that version.

odizle’s picture

Hi guys,
I have a fresh instal D 7.20 and Rate 1.6 but still have this problem. any ideas why this might happen?

Edit: So the case is that, I am using thumbs up widget. when viewing the node the widget shows "0 users have voted." after voting it updates to "Only you voted." but when reloading this page or even loading it on a different browser, it goes back to "0 users have voted." Then when voting again with different user and browser it updates to "2 users have voted, including you." then again when reloading the page goes back to "0 users have voted."

Any ideas?
Thanks

Jedd Casella’s picture

Issue summary: View changes

@odizle

It's most likely that you have the checkbox ticked to "cache pages for anonymous users" at /admin/config/development/performance

You'll find un-selecting that option will resolve the issue. The downside is that pages will take longer to load.

Hope that helps.

Cheers,

Jedd

bioschaf’s picture

@odizle

Did you happen to find a solution? I have exactly the same behavior on Drupal 7.26 and have not found any clue on what this might be or where it comes from.

Edit: Sorry, found your bug report and was able to fix it. This page came up first when trying solve my problem.

charubachi’s picture

Version: 7.x-1.5 » 7.x-1.7
Status: Closed (fixed) » Active
StatusFileSize
new31.17 KB

I am using rate 1.7 and getting the same issue.
I created the widget for thumbs up/down, even though I selected "Users vote if available, empty otherwise" option for "Which rating should be displayed".
Am I missing something?

ivnish’s picture

Status: Active » Closed (outdated)

Drupal 7 is EOL. Issue will be closed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.