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

Bug #1500 There should be a fallback for displayfield other than select_display_field
Submitted: 2004-05-25 18:49 UTC Modified: 2006-12-16 02:40 UTC
From: justinpatrin Assigned: mw21st
Status: Closed Package: DB_DataObject_FormBuilder
PHP Version: Irrelevant OS: N/A
Roadmaps: (Not assigned)    
Subscription  


 [2004-05-25 18:49 UTC] justinpatrin
Description: ------------ I've just run into this again and it can get quite annoying. I tend not to use the select_display_field option for FormBuilder in the main ini file simply because my tables don't all have the same field to display. Also, though, it just makes sense to have a fallback if that config option wasn't filled out. I would suggest usong $pk if there is nothing in the config. Here's what I would suggest for the $displayfield section. if ($displayfield == false) { if(isset($_DB_DATAOBJECT_FORMBUILDER['INI'][$opts->database()][$opts->tableName().'__display_fields'])) { $displayfield = $_DB_DATAOBJECT_FORMBUILDER['INI'][$opts->database()][$opts->tableName().'__display_fields']; } else if(isset($opts->select_display_field) && !is_null($opts->select_display_field)) { $displayfield = $opts->select_display_field; } else if (isset($_DB_DATAOBJECT_FORMBUILDER['CONFIG']['select_display_field']) && !is_null($_DB_DATAOBJECT_FORMBUILDER['CONFIG']['select_display_field'])) { $displayfield = $_DB_DATAOBJECT_FORMBUILDER['CONFIG']['select_display_field']; } else { $displayfield = $pk; } } The displayfield section should also only be in getDataObjectSelectDisplayValue, but since order also depends on it, this can't be done right now. Perhaps the ordering fields should default to $pk as well instead of $displayfield....not sure of that, but it's an option.

Comments

 [2004-05-31 10:49 UTC] mw21st
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.