IE Javascript error for Ranking Poll vote
| Project: | Advanced Poll |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | JavaScript |
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?
| Attachment | Size |
|---|---|
| advpoll-vote.js_.ie-fix.patch | 1.98 KB |
