PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #7739

problems with setDafaults

Details

Submitted2006-05-28 20:14 UTC
Fromtomekomel at wp dot pl
StatusBogus
PackageHTML_QuickForm
PHP Version5.1.0
OSWin XP
Roadmaps(Not assigned)

Comments

[2006-05-28 20:14 UTC] tomekomel at wp dot pl

Description:
------------
Welcome!

I create a bigger form for my web users profiles using QuickForm. This form gets data from 3 tables: profile, intresting, searching. When user have data only in table profile everything is OK, but when form get data from all 3 tables to edit this data, then I have a problem. I'm trying to solve it several days but I cant so please help me.

Test script:
---------------
I set the defaults data in the beginning:
if (isset($profil) || isset($interesting) || isset($searching))
{
$data = $profil + $interesting+ $searching;
$form->setDefaults($data);

}
Fields intersting and searching in form are a group of checkbox. I create this group using:

foreach($intrestingAll as $key => $value)
{
$intresting[] = HTML_QuickForm::createElement('checkbox', $key,null, $value);
}

$form->addGroup($intresting, 'intresting',
'Intrested in:', ' ');

Searching fields in the same way.

Here is an example of variable $data:

Array
(
[login] => jafeth
[id] => 1
[plik] =>
[kraj] => Polska
[miasto] => Białystok
[wojewodztwo] => Podlaskie
[plec] => 0
[dataur] => 946681200
[stan_cyw] =>
[dzieci] => 0
[wyznanie] =>
[picie] => abstynent
[palenie] => nie palę
[zywnosc] =>
[zawod] =>
[wyksztalcenie] =>
[budowa] =>
[oczy] =>
[zdanie_opis] => Jestem spokojnym człowiekiem
[ogolny_opis] =>
[poszukuje_opis] =>
[intresting] => Array
(
[1] => true
[2] => true
[7] => true
[24] => true
)

[searching ] => Array
(
[4] => true
[7] => true
)

)

Expected result:
----------------
I would like to use this script to edit this form, now it is usefull only to add new profile. I cant edit it when tables intresting or searching have some data...
Please for help.

Thank You very much!

Actual result:
--------------
Quick Form throws sth like that:

Fatal error: Call to a member function getName() on a non-object in
D:\XAMP\xampp\php\pear\HTML\QuickForm\group.php on line 391

[2006-05-29 09:46 UTC] tomekomel at wp dot pl

It works! Thank You very very much. I was writing to many support forums but nobody could help me. Sorry for disturbing and thank You!