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

Bug #6894 _reorderElements unusual case
Submitted: 2006-02-22 18:48 UTC
From: car at cespi dot unlp dot edu dot ar Assigned: justinpatrin
Status: Closed Package: DB_DataObject_FormBuilder (version 1.0.0RC2)
PHP Version: Irrelevant OS: ALL
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 : 47 - 5 = ?

 
 [2006-02-22 18:48 UTC] car at cespi dot unlp dot edu dot ar (Christian Adrián Rodriguez)
Description: ------------ In case _getFieldsToRender() is disjoint from preDefOrder, there is a problem in the _reoprderElements method. The error rises at line 1652. In know it is a very unusual case, but I think declaring the ordered variable as an empty array is a cleaner solution than the current one. Test script: --------------- I propose declaring $ordered variable as empty array in line 1635

Comments

 [2006-02-22 18:50 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!
 [2006-02-22 19:03 UTC] car at cespi dot unlp dot edu dot ar
if you look at the code, in the lines I mentioned, In my opinion, it make sense to declare the variable. The example you asked me to post could by like this: class DataObjects_Distrito extends DB_DataObject { var $fb_fieldLabels = array('id_localidad'=>'Localidad','id_entidad'=>'Entidad'); var $fb_linkDisplayFields = array('nombre'); /************ The following two lines raise the bug ****** var $fb_preDefOrder=array('nombre'); var $fb_fieldsToRender=array('email'); // ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */ public $__table = 'distrito'; // table name public $id; // int(11) not_null primary_key auto_increment public $nombre; // string(100) not_null unique_key public $id_localidad; // int(11) not_null multiple_key public $direccion; // string(255) public $telefono; // string(100) public $email; // string(100) public $id_entidad; // int(11) not_null multiple_key /* Static get */ function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_Distrito',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE }
 [2006-02-22 19:12 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!
 [2006-02-22 19:15 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!
 [2006-02-22 19:21 UTC] car at cespi dot unlp dot edu dot ar
The problem with the example I gave, and the following two lines: var $fb_preDefOrder=array('nombre'); var $fb_fieldsToRender=array('email'); That are disjoint sets of table fields of my do, gives the following error: /usr/share/php/DB/DataObject/FormBuilder.php (1652) Undefined variable: ordered So I suggested a solution to, in my opinion, a better or cleaner way to write the _reorderElements method. Please take a look at the code in the error line, and then consider declaring the ordered variable. But as it is an unusual case, you should not consider my report, and instead advice not to declare those variables disjoints.
 [2006-02-22 19:31 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!