Active
Project:
Decisions
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2008 at 04:05 UTC
Updated:
1 Jul 2010 at 13:16 UTC
Preview doesn't keep the "decision settings", generates a bunch of warnings under E_ALL and always adds more choices.
We need to rewrite that damn form.
Comments
Comment #1
anarcat commentedMaybe we should look at the poll.module here.
Comment #2
anarcat commentedFixed in CVS by the horrible merge.
Comment #4
polskikrol commentedThis appears to be broken in 6.x-1.x-dev (May 27th commit).
Attempt to modify an existing decision, modify end date, and hit preview. I get extra random new choices and the date I entered is not retained. Would say this is still broken.
Comment #5
mwm commentedI think I've figured out what's wrong with preview form. decisions_form() tries to set the #default_value of the 'uselist' form element (for example) using the contents of $node->uselist, but this doesn't work during preview because the node hasn't been submitted yet. The form settings seem to be stored in $form_state['values']['settings'] during preview.
What I did to fix this locally is copy each element of that array to its corresponding $node variable inside the (otherwise useless) if statement at the top of the function. I tried just assigning the '#default_value' variables directly from their $form_state['values']['settings'] variables, but that array isn't populated during node editing.
I'd submit a patch, but my code is too heavily modified from the stock decisions module for that to be useful. I suspect there's a more standard and elegant way to fix this anyway.
I wasn't able to figure out why the preview itself isn't showing up correctly, but I suspect the cause is related (e.g. variables like $node->maxchoices might not be set during preview)