Closed (outdated)
Project:
Flag
Version:
7.x-3.x-dev
Component:
Flag core
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Oct 2012 at 18:54 UTC
Updated:
19 Aug 2025 at 12:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dalinComment #2
joachim commentedThanks for the patch!
Would be great to get a review from someone with anon flagging set up.
Comment #3
joachim commentedCould you explain a bit more about the userFlags problem?
Would this fix #1821942: Adding error handling to JS too?
Comment #4
dalinI'm a bit rusty on my understanding of how JavaScript prototypes and such work. But everything in JS is an object, even arrays. And so they have methods. Arrays have a method called 'filter'
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Obj...
So if you do a for loop iterating over the array, you will iterate over the methods as well. The .match() statement obviously fails here and in the case of IE7/8 the script just dies. This is the primary issue that $.each() overcomes.
So in short, yes #1821942: Adding error handling to JS tries to fix the same problem in a different way. IMO $.each() is the better way to go rather than just ignoring all errors.
Comment #5
joachim commented> IMO $.each() is the better way to go rather than just ignoring all errors.
I am entirely in agreement with that!
In which case, I'll close that one as a duplicate. Thanks for the explanation.
Comment #6
joachim commentedI'd really like this patch to get at least one review before I commit it.
Comment #7
joachim commentedTagging.
Comment #8
MaWebDesigns commentedNot 100% sure if this is related, but my problem is that the flag icons simply never change from unchecked to checked like they do on other browsers (I am using simple ASCII text as my check and unchecked marks). This is true for anonymous or logged-in users.
I tested this patch against 7.x-3.4, and while it does-no-harm it did not solve my problem.
I have no other JavaScript errors that are being reported by my browser, so I'm not sure what my issue with flags is (other than IE8 itself)
Comment #9
ivnishDrupal 7 is EOL. Issue will be closed, but patches are still here