Hello, I've been using this module in my site, but recently, I found out that the javascript voting ability stopped working. As far as I could remember, it started when I created a custom widget in the site. Since then the feature is gone, no matter how many times I clear all cache, disable/uninstall/install/enable the module, delete the widgets created then create new etc. I installed it on my other test sites, and it's working fine.

Anyone knows any workaround on this? Incompatible modules/scripts/themes? I am using Commons profile but installed it on other Commons installation and it's working fine. Just doesn't work on mine. Any help is appreciated. Thanks!

Comments

mauritsl’s picture

Status: Active » Postponed (maintainer needs more info)

There are no known conflicts to me. Except for Fivestar theming in older 7.x releases.

Are there any JavaScript errors?

jayjaydluffy’s picture

Status: Postponed (maintainer needs more info) » Active

I'm not sure. Can you help me on how to find JS errors?

I tried looking at Google Chrome dev tool and I saw this:
rate.js:6 - Uncaught TypeError: Cannot read property '1' of null

The JS here:

Drupal.behaviors.rate = function(context) {
  $('.rate-widget:not(.rate-processed)', context).addClass('rate-processed').each(function () {
    var widget = $(this);
    var ids = widget.attr('id').match(/^rate\-([a-z]+)\-([0-9]+)\-([0-9]+)\-([0-9])$/);
    var data = {
    content_type: ids[1],

content_type: ids[1] is line 6. Do you think the problem is there? I installed the same custom widget in other local site but there are no errors. Thanks in advance for more help.

caspercash’s picture

is there a solution to this problem? i think i am experiencing the same.. its just that the average rate doesn't seem to give a correct value.. did you manage to solve this one jayjaydluffy?

Rev314159’s picture

I had a similar problem, getting the content_type: ids[1] error. I had created a custom rate widget and styled it with CSS. I used my own time cut-off function instead of what is supplied with the module, because I wanted the cut-off to be determined from a specific field in the node. After the time period ended, I would recreate the <div>,<ul>,<li> structure the module had supplied. Since I had used the .rate-widget class on this new <div>, the module tried to act on it. It added the .rate-processed class to it, but would fail after that. What I did to fix this was create a new CSS class that mimicked how I styled .rate-widget and made sure I never manually used a div with the class .rate-widget. I'm not sure this will help you, but you might check to make sure that class isn't being called elsewhere.

lamp5’s picture

Issue summary: View changes
Status: Active » Closed (outdated)