Closed (fixed)
Project:
Advanced Poll
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2007 at 18:04 UTC
Updated:
30 Dec 2007 at 15:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
anders.fajerson commentedNice one. Looks good to me. This also applies when deleting choices, right? (currently not possible though, see http://drupal.org/node/199103)
Comment #2
ChrisKennedy commentedTrue, and now that you mention it I need to tweak the algorithm slightly to account for potential deleted choices.
I also removed the edit-changed line used in this area of the code, since that variable is only used for non-javascript node editing.
Comment #3
anders.fajerson commentedSeems to work great. The id of the dynamically added choices doesn't really matter though? E.g they could just as well be new-choice-1, new-choice-2? Just an observation.
And I can't reproduce 2. (removing all choices) reported at http://drupal.org/node/199103#comment-652905, so that's all good.
Comment #4
ChrisKennedy commentedRight, the id doesn't truly matter and it could be a different string if we wanted.
Comment #5
anders.fajerson commentedI thinking about saving some rows of JS by skipping that highest id algorithm, and going for something simpler. What do you think?
Comment #6
ChrisKennedy commentedWell, it's used for the name, id, and label reference. If we take out the unique ID at the very least the label won't link to the input, and I don't think there will be a much simpler way to create a unique id considering that a single jQuery replace() converts the name, id, and label reference all at once.
I think (but I'm not sure) that it will be more of a pain to replace the current regex to account for separate string constructions. Plus if you remove choices and then add them I think it would be more work to maintain a new incremented id (i.e. if we removed new-choice-1 and added a new choice we would have to decrement the new choice counter, but not if we removed an old choice).
Comment #7
anders.fajerson commentedOk then, let's get this is.
Comment #8
ChrisKennedy commentedhttp://drupal.org/cvs?commit=91558
Comment #9
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.