Re: FormBuilder upgrade 0.14.0 -> 0.17.1

From: Date: Tue, 21 Jun 2005 17:19:31 +0000
Subject: Re: FormBuilder upgrade 0.14.0 -> 0.17.1
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19714@lists.php.net to get a copy of this message
On 6/21/05, Thomas Balthazar <tba@voxteneo.com> wrote: > Hello Justin, > > Thank you for your help. > I do appreciate! > > I've just downloaded FormBuilder 0.17.2, replaced the old files by the > new one, and I get the following error message : > > -- > Notice: Undefined variable: className in C:\Documents and > Settings\TBA\My Documents\www\trame\pear\DB\DataObject\FormBuilder.php > on line 868 > -- Thanks, I missed this. This is fixed in CVS. However....(seel below) > > I'm using my own driver, and it seems that it's class name cannot be found. > > Any clue? > Aha, using your own driver. Did you read the release notes for the releases from 0.14.0 to 0.17.2? It's important to check them as FormBuilder is still Beta. Of particular interest to you is the 0.16.0 notes: http://pear.php.net/package/DB_DataObject_FormBuilder/download/0.16.0 I changed the driver structure of FormBuilder there. Basically if you were previously using your own "driver" then you should change it to extend DB_DataObject_FormBuilder instead of QuickForm. Then use your new class as the base FormBuilder class. Wait... Hmmm, interesting, it seems I forgot to update the docs. And now that I look at it I have no idea how you can use a base class with the current implementation of create(). I've made a change in CVS which would allow you to "fix" this. See: http://cvs.php.net/co.php/pear/DB_DataObject_FormBuilder/FormBuilder.php?r=1.192#850 for the new implementation. Also see: http://opensource.21st.de/22.html#A2 for updated docs. However, be on the lookout as I don't really like the look of what I've done there. It complicates things.... I'll let you know if I change anything. > > Justin Patrin wrote: > > 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

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