Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The way rate.js calls attachBehaviors causes the get request to get attached to unwanted elements. For example, if you use the smileys module every time you rate something it duplicates the "more" link..
Line 30 of rate.js:
Drupal.attachBehaviors(p.get(0));
Should be:
Drupal.behaviors.rate(p.get(0));
Otherwise things like this happen:
http://i861.photobucket.com/albums/ab174/gutretch/Picture5-1.png
Comments
Comment #1
bertboerland CreditAttribution: bertboerland commentedthanks for reporting, we wil look in to this
Comment #2
mauritsl CreditAttribution: mauritsl commentedThis is not a bug in Rate, but in the smileys module.
Your suggestion indeed solves the problem at first. But other behaviors which were added to the widget will stop working anymore. This is the case for the javascript on the fivestar widget (will be added in rate 1.2).
The smileys JS has to know if it already processed items by setting a processed class, making it save to call attachBehaviors multiple times.
Rate does this with the following code:
Rate is not the only module which calls Drupal.attachBehaviors! Various others are doing:
http://drupal.org/node/983738
http://groups.drupal.org/node/20318
This seems to be the usual way, so it really has to be fixed in the smileys module and not in rate.