Re: FormBuilder and update with frozen fields

From: Date: Thu, 13 Oct 2005 08:20:46 +0000
Subject: Re: FormBuilder and update with frozen fields
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21433@lists.php.net to get a copy of this message
Il 22:11, mercoledì 12 ottobre 2005, Justin Patrin ha scritto: > On 10/12/05, Alessandro Pasotti <ale.pas@tiscali.it> wrote: > > Hello, > > > > I saw a similar post with frozen dates, but cannot solve my problem, > > > > It seems that frozen fields (excluded from userEditableFields) are > > rendered as HIDDEN values, these are hence passed to the form. > > > > This is normal behavior for DB_DO. FormBuilder does *not* set the > values of frozen (non-editable) fields to the DO. They are set when > you fetch. However, DB_DO always sends all fields in an UPDATE call if > a DO is not provided in the update() call. This is the problem, DO contains all old fiels set (by me, see later), then FormBuilder correctly overwrite them (if not frozen), but _do->update() receives all the fields (old and overwrited new), hence update all. > > However, FormBuilder *is* set up to only update what has been updated > by passing in the original DO to the update() call. Are you using the > newest version of FormBuilder? @version $Id: FormBuilder.php,v 1.204 2005/08/23 20:54:18 justinpatrin Exp $ > Are you setting the DO correctly on > submission? This is maybe the issue, if an $id is passed (I always set an hidden id in the form), I always call $do->get($id) and populate the object, this seems necessary if the update fails and I want to redisplay the form with errors (I do some other processing with this $id, to get more detailed error info). > How do you know that the query contains everything? I print all the queries, overriding DO _query(). Thanks for helping. -- Alessandro Pasotti ICQ# 245871392 Linux User #167502

« previous php.pear.general (#21433) next »