So I have worked around the problem I discovered. In the BaseFormPropel
class I overrode the bind method so that, in essence, $taintedValues start
with the default values instead of starting with all null values. This way
if I do not pass in a value, the current value is not changed. I can still
set a value to null if I pass in the key with a null value, but I can also
now leave a value unchanged.
public function bind(array $taintedValues = null, array $taintedFiles =
null)
{
$taintedValues = array_merge($this->getDefaults(), $taintedValues);
parent::bind($taintedValues, $taintedFiles);
}
I think it would be nice to have this type of functionality available as a
option in forms generally, especially in a REST context. Anyone else think
this would be nice, or see any blatant problems with this?
Thanks,
paul
On Fri, Oct 3, 2008 at 10:13 AM, Paul Jones <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a question about how forms are supposed to behave. I generated
> a basic crud interface and interact with it via ajax. When I call the
> update method a sfFormPropel form is created, the post data is bound
> to the form and then the form is saved if it is valid. All the basic
> stuff. The only interesting thing is that if I only submit the id and
> name of the object, then all the other fields are saved as null. I
> expected fields that I did not submit to be left untouched. Did I have
> the wrong expectations or did I uncover a bug?
>
> I am using symfony 1.2 HEAD.
>
> Thanks in advance,
> paul
>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---