Re: FormBuilder upgrade 0.14.0 -> 0.17.1
| From: | Justin Patrin | Date: | Fri, 17 Jun 2005 16:56:16 +0000 |
| Subject: | Re: FormBuilder upgrade 0.14.0 -> 0.17.1 | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19667@lists.php.net to get a copy of this message | ||
On 6/17/05, Thomas Balthazar <tba@voxteneo.com> wrote:
> Hello everybody,
>
> I've got a Web Application that is working fine with FormBuilder 0.14.0.
>
> Now, I'm trying to upgrade from FormBuilder 0.14.0 -> 0.17.1 but I get
> the following error message :
>
> --
> Warning: Call-time pass-by-reference has been deprecated - argument
> passed by value; If you would like to pass it by reference, modify the
> declaration of call_user_func(). If you would like to enable call-time
> pass-by-reference, you can set allow_call_time_pass_reference to true in
> your INI file. However, future versions may not support this any longer.
> in C:\Documents and Settings\TBA\My
> Documents\www\trame\pear\DB\DataObject\FormBuilder.php on line 2090
> --
Thanks for the bug report, I thought I'd fixed all of those issues.
This is fixed in the new release (0.17.2).
>
> Can anybody please explain me what is happening?
> I really can't figure out what's wrong.
This is due to calling a funciton like this:
func(&$obj);
It forces the function call to pass the first parameter by reference,
meaning that the function can alter $obj and the caller will see the
difference. This is needed if you leave DB_DataObject in its
overloaded state (which is broken for this and other reasons). I've
switched most of the callback calls in FormBuilder to use
call_user_func_array which both forces the pass-by-ref *and* avoids
those warnings.
>
> Which part of my code must be adapted to allow me to upgrade from 0.14.0
> to 0.17.1?
Hopefully none. :-) Let me know if you have further issues.
>
> Thanks in advance for your help, it will be much-much appreciated.
>
> Thomas Balthazar.
>
> P.S. : the reason why I want to upgrade is :
> - I use crossLinks to display m:n relationship in my forms
> - I configure it to display values in a <select>
> --> I would like to be able to modify the size of the <select> : when
> there is a lot of values, I would like them to be displayed in a 5 lines
> <select> with a scrollbar (I really really need it!). Will the new
> Collapse option help me to do that?
>
Nope, that's not what collapse does. If you want to change the size of
the select the easiest way is to use the fieldAttributes option:
http://opensource.21st.de/23.html#A41
Put this in your DataObject class:
var $fb_fieldAttributes = array('nameOfSelect' => array('size' => 5));
However, the collapse option may be of help to you. If you choose to
use chekcboxes instead of a multi-select and set collapse to true the
crossLink will automatically be collapsed to show only the selected
options.
I realize that this may be confusing, so here's an example:
http://pear.reversefold.com/EditRecord.html
Scroll down to the Songs listing and click "Show All". (Note: this
example also has crossLinkExtraFields set.)
--
Justin Patrin