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

Bug #6582 malfunction sort
Submitted: 2006-01-25 17:18 UTC
From: frenky dot pv at atlas dot cz Assigned: wiesemann
Status: Closed Package: Structures_DataGrid (version -)
PHP Version: 5.1.2 OS: WinXP
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 : 39 - 26 = ?

 
 [2006-01-25 17:18 UTC] frenky dot pv at atlas dot cz
Description: ------------ Structures_DataGrid 0.6.3 beta file: Structures\DataGrid\DataSource\Array.php bad code: function sort($sortField, $sortDir, $ar = array()) good code: function sort($sortField, $sortDir, &$ar = array())

Comments

 [2006-01-25 20:00 UTC] at php dot net
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. --- Please choose the right package next time, 'Documentation' is the wrong one.
 [2006-01-29 10:12 UTC] wiesemann
Re-opening, as the fix only works for PHP5. For PHP4 and PHP5 compatibility we'll need to return $ar (*), I think. Some kind of BC break (= small API change), but as this can never have been working, that should not be a problem. Comments? (*) only if $ar parameter was given, of course (= static usage)
 [2006-02-01 22:39 UTC] olivierg at php dot net
I think this DataSource_Array::staticFetch() method is not a good idea. Actually, only the DB driver used this, where the CSV, RSS and XML drivers extend the DataSource_Array to achieve the same result. That's not coherent. For now, I think, that the DB driver should simply work like the CSV, RSS and XML drivers, by subclassing DataSource_Array. This way, the staticFetch() method and this third $ar parameter to DataSource_Array::sort() can be removed. I don't think that this will cause BC breaks, because these were some sort of internal DataGrid optimization, and not part of the official datasource driver interface. The basic optimization idea was not to subclass DataSource_Array, which already subclasses DataSource_Common, because the class tree is getting big. But I believe that this optimization is not really necessary, and anyway that's not a good way to achieve it. If we really want to do such optimization, then we can move the DataSource_Array routines into DataSource_Common.
 [2006-02-15 20:50 UTC] wiesemann
I've changed the code as suggested by Olivier. This also fixes bug #6779.