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

Bug #7870 MDB2 driver removes ORDER BY statement
Submitted: 2006-06-12 07:05 UTC
From: olivierg Assigned: wiesemann
Status: Closed Package: Structures_DataGrid_DataSource_MDB2 (version CVS)
PHP Version: 4.4.2 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2006-06-12 07:05 UTC] olivierg (Olivier Guilyardi)
Description: ------------ First I call : bind ("SELECT * FROM my_table ORDER by some_field"); Then, I create all of my columns with addColumn(). All of my calls to "new Structures_DataGrid_Column()" have no third argument ($orderBy), so that there are no sortable fields. That's what I want. But, in the resulting datagrid, the ORDER BY statement in the bind() call has no effect. That's because the MDB2 driver suppresses it. I think that the MDB2 driver is intrusive on this issue. It should "try" to respect the ORDER BY statement if it exists.

Comments

 [2006-06-20 16:45 UTC] wiesemann (Mark Wiesemann)
changed package, assigned this to me
 [2006-06-21 12:23 UTC] pajoye (Pierre-Alain Joye)
changed pkg back to SDG
 [2006-06-21 15:07 UTC] olivierg at php dot net (Olivier Guilyardi)
That's a bug for Structures_DataGrid_DataSource_MDB2 not Structures_DataGrid_DataSource_DataObject. Since bug #7946 appears to be fixed, I correct this.
 [2006-06-29 23:20 UTC] olivierg at php dot net (Olivier Guilyardi)
My thoughts about this : if there is no HTTP sorting request then leave the ORDER BY statement as it is if there is an HTTP sorting request then I see 2 possibilities : 1) either the request replace the ORDER BY statement 2) or the request is appended. Ex: "SELECT .. ORDER BY a" and "?orderBy=b" ---> "SELECT .. ORDER BY a,b" There could be an option to decide what to do between 1) and 2). But this option would be redundant with the DataGrid::addDefaultSort() method that does exactly what 1) provides. And I like 2) because it is the least intrusive. So I would recommend 2), no option, and proper documentation that talks about addDefaultSort() for those who need 1).
 [2006-07-02 20:20 UTC] wiesemann (Mark Wiesemann)
> So I would recommend 2), no option, and proper documentation that > talks about addDefaultSort() for those who need 1). Apart from that it is setDefaultSort() instead of addDefaultSort(), I like this idea -- it makes the behaviour consistent and it is easy to understand for people without having to set additional options.
 [2006-07-03 10:20 UTC] olivierg at php dot net (Olivier Guilyardi)
Agreed. Are you taking this in charge?
 [2006-07-03 20:33 UTC] wiesemann (Mark Wiesemann)
> Are you taking this in charge? Yes, I'll work on it this week.
 [2006-07-07 15:32 UTC] wiesemann (Mark Wiesemann)
Okay, the changed code is in CVS, comments and test are welcome. We should discuss (via email) whether we should put the GENERAL NOTES section from the comment block into the manual (on a similar way as the options, but without inheritance, of course). Such a section exists also in the Smarty renderer, for example.
 [2006-08-02 17:55 UTC] olivierg at php dot net (Olivier Guilyardi)
It does work very fine. Thanks :-) Let's close this.