Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.6

Bug #4935 DB_Table_Quickform: Element names as Array-Keys not respected for radio buttons
Submitted: 2005-07-28 13:00 UTC
From: christian dot meixner at brandao dot de Assigned: pmjones
Status: Closed Package: DB_Table
PHP Version: 4.3.3 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 41 + 29 = ?

 
 [2005-07-28 13:00 UTC] christian dot meixner at brandao dot de
Description: ------------ DB_Table Version 1.0.1 I generate a HTML-Inputform for a DB_Table instance using "$myDB_Table->getForm();" I used the second parameter for this method, so that all Inputs will be submited within one array like: "$myDB_->getForm($cols,'fieldsArray'");". But this parameter won't be used for the generated radio buttons. To fix this I've replaced line 210 in DB/Table/QuickForm.php with the following lines: if (isset($arrayName) && $arrayName !='') { $form->addGroup($element, $arrayName.'['.$cols_keys[$k].']', $cols[$cols_keys[$k]]['qf_label']); } else { $form->addGroup($element, $cols_keys[$k], $cols[$cols_keys[$k]]['qf_label']); } Test script: --------------- /* part of DB Schema definition array */ var $col = array('radioExample' => array( 'type' => 'integer', 'qf_type' => 'radio', 'qf_vals' => array(1 => 'one', 2 => 'two') ), ) $showCols = array( 'radioExample' => '', ); $myDB_->getForm($showCols ,'fieldsArray'"); Expected result: ---------------- <!-- expected HTML-Source of the radiobutton -> <input value="1" id="qf_398657" name="fieldsArray[radioExample]" type="radio"><label for="qf_398657">one<br></label> Actual result: -------------- <!-- expected HTML-Source of the radiobutton -> <input value="1" id="qf_398657" name="radioExample" type="radio"><label for="qf_398657">one<br></label>

Comments

 [2005-08-06 16:40 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!