When max_choices is set to 0 it doens't "stick" due to a missing isset(). Added that to max_choices and a to some other #default_values.

Comments

ChrisKennedy’s picture

Status: Needs review » Needs work

This is correct for max_choices and algorithms, but for start_date and end_date it will mess up the default time when the values are 0 (i.e. they aren't being used). And for the question we don't need to add the isset, because the preceding IF already ensures that it is set. Also, this made me notice that for binary polls we seem to be inserting blank algorithms rather than passing the default algorithm as a hidden field.

(sorry for taking a while to review this)

anders.fajerson’s picture

Priority: Normal » Critical
anders.fajerson’s picture

Status: Needs work » Needs review
StatusFileSize
new3.25 KB

This should adress the mentioned issues. I'm not that happy with the code comment on the use of !empty instead of isset().

ChrisKennedy’s picture

What about:

Use !empty() because 0 signifies that the default date should be used.

anders.fajerson’s picture

StatusFileSize
new3.25 KB

Better.

ChrisKennedy’s picture

Status: Needs review » Reviewed & tested by the community

RTBC - just be sure to fix that last comment.

anders.fajerson’s picture

Changed both places to // Use !empty() because 0 signifies that no date should be used. in both places. Committed: http://drupal.org/cvs?commit=89970

anders.fajerson’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.