When using this transformer with a ChoiceField that has "expanded" set
to "false"  the transformer is passed an empty  string when no options
are selected.

This breaks the reverseTransform when it tries to use this parameter
as the second argument to array_search.

This seems to be caused by the ChoiceField providing an array for an
empty value when isExpanded is true and not modifying the value (an
empty string) when isExpanded is false.

I fixed it for myself by changing ChoiceField as follows:

    protected function reverseTransform($value)
    {
        if ($this->isExpanded()) {
            $choices = array();
            // ....
        }
        if (!$value) {
            $value = array();
        }
        return parent::reverseTransform($value);
    }


But maybe there is a better way ...
-- 
Dan Leech

Web Developer
www.dantleech.com

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to