IE Javascript error for Ranking Poll vote

geoffreyr - October 16, 2009 - 03:52
Project:Advanced Poll
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:JavaScript
Description

When voting on a ranking poll, removing issues from the ranking table causes the following error in IE8 and IE7 Compatibility Mode:

Message: 'nodeType' is null or not an object
Line: 133
Char: 11
Code: 0

Specifically, it triggers in the following cases:

  • Trying to remove items from the ranking table (Error triggered on the first try. Element is properly removed the second time.)
  • Trying to add items previously removed from the ranking table (Error triggered on the first try, and again, element is properly added the second time.)

For some reason, IE's Javascript engine doesn't like the clone(true) call used to copy the old $choice object to $newChoice.

This happens with the current dev version of advpoll, tested on both Drupal 6.9 and 6.14, with jQuery version 1.2.6.

I've attached a patch that attempts to get around this problem by creating $newObject from scratch and copying over the old object's ID and children. It could probably be handled in a tidier fashion but it produces the correct behaviour without causing this error. Is this fix applicable?

AttachmentSize
advpoll-vote.js_.ie-fix.patch1.98 KB
 
 

Drupal is a registered trademark of Dries Buytaert.