Re: [Formsess-devel] possible assign force bug
Status: Beta
Brought to you by:
mrkatana
|
From: David <da...@df...> - 2004-06-14 12:07:19
|
Labas Zilvinas,
the current developement version features some major changes and I
think the problem you described does not occur there anymore.
I recommend you to either pull the latest version from the subversion
repository or to download the latest snapshots both should be pretty stable.
- david
On Sun, 13 Jun 2004 15:36:30 +0000
Zilvinas Saltys <ar...@es...> wrote:
> Hello,
>
> I was trying to do the following:
>
> $new = $this->module->getNew($gid);
>
> $fs->reset();
> $fs->assignArray($new);
>
> $fs->assign('body', preg_replace('!<br.*>!iU', "",
> $fs->get_value('body')), true);
>
> Reassigning the body does not work in 2.0.0-pre. The assign function
> is in this chain:
>
> assign->_save_fields->_read_field_value
>
> In the read_field_value:
>
> // first check within the cached values so that we don't read twice
> if (isset($this->_fieldvalues[$field])) {
> return $this->_fieldvalues[$field];
> }
>
> This couses the problem. I was able to fix this by adding an elseif
> under the first if sentence:
>
> // If overwrite was not asked, we test if a value exists
> if (!$force && (isset($this->_sess_space['values'][$field]) &&
> !empty($this->_sess_space['values'][$field]))) {
> return;
> }
>
> elseif ($force && isset($this->_fieldvalues[$field]))
> {
> unset($this->_fieldvalues[$field]);
> }
>
> Maybe i fooled my self and this is not a bug and i don't know
> something :) Please tell me.
>
> Bye
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the new InstallShield X.
> >From Windows to Linux, servers to mobile, InstallShield X is the
> one installation-authoring solution that does it all. Learn more and
> evaluate today! http://www.installshield.com/Dev2Dev/0504
> _______________________________________________
> Formsess-devel mailing list
> For...@li...
> https://lists.sourceforge.net/lists/listinfo/formsess-devel
>
|