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

Bug #13036 'fieldTag' option doesn't work as documented
Submitted: 2008-02-01 10:26 UTC
From: wiesemann Assigned: wiesemann
Status: Closed Package: Structures_DataGrid_Renderer_XML
PHP Version: Irrelevant OS: Irrelevant
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 : 44 - 10 = ?

 
 [2008-02-01 10:26 UTC] wiesemann (Mark Wiesemann)
Manual page: package.structures.structures-datagrid.structures-datagrid-renderer.xml.php "fieldTag"-Option is not clearly documented, "he name of the tag for each field inside a row, without brackets. The special value '{field}' is replaced by the field name." is only true, if only {field} is given as fieldname. I tried to give 'column{field}' as a fieldname and expected it to produce something like column1, column2, ... but instead it did column{field} again and again. Did a quick fix: Inside the buildRow-Method of the Structures_DataGrid_Renderer_XML-Class one needs to replace foreach ($data as $col => $value) { $field = $this->_columns[$col]['field']; $tag = ($this->_options['fieldTag'] == '{field}') ? $field : $this->_options['fieldTag']; with foreach ($data as $col => $value) { $field = $this->_columns[$col]['field']; $tag = ($this->_options['fieldTag'] == '{field}') ? $field : str_replace('{field}',$field,$this->_options['fieldTag']); And it will work as expected. Best Regards, Martin

Comments

 [2008-02-01 10:27 UTC] wiesemann (Mark Wiesemann)
User note was reported by: info(at)martin-lehnert(dot)de.
 [2008-03-26 18:57 UTC] wiesemann (Mark Wiesemann)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.