Hi Manuel,
Thanks for your help...
Is metastorage NOT supposed to replace this with a NULL in the SQL in
this case?
Is metastorage SUPPOSED to produce invalid SQL in this instance?
Shouldn't it instead be either substituting a NULL in the SQL? Or
otherwise producing an error in the 'persist' routine before trying to
run invalid SQL?
In any case, thanks for the advice on the preferred way of handling
the situation - I'll give it a try. It's unfortunate that it is
necessary, but it should do the job for now.
Cheers,
Nik.
On 19/09/2008, at 4:23 PM, Manuel Lemos wrote:
> Hello,
>
> on 09/19/2008 02:01 AM Nik Sands said the following:
> > The code immediately below fails to save (and gives the debug output
> > shown below), but if I uncomment the two "Work around" lines, it
> saves
> > successfully. Why is this?
> >
> > The debug output is the same as posted earlier in this topic.
>
> I think there is some confusion. An empty string is one thing. An
> undefined value is another thing.
>
> > $grams = $form->GetInputValue("item_".$id."_grams");
> > if ( IsSet($grams) )
>
> The above should be:
>
> if(strlen($grams))
>
> > $inventory_item->grams = $grams;
> > else
> > $inventory_item->grams = null;
>
> --
>
> Regards,
> Manuel Lemos
>
> Find and post PHP jobs
> http://www.phpclasses.org/jobs/
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
>
========================================================
NIXANZ - http://nixanz.com/
Like to help out as a beta tester? Let me know which application
you'd like to test.
[Non-text portions of this message have been removed]