gudman Posted February 17, 2017 Posted February 17, 2017 Hello, guys, I think that I found a small problem with system/Helpers/Table/Db.php: /* Count results (for pagination) */ $count = \IPS\Db::i()->select( 'count(*)', $this->table, $where ); and... $count = $count->first(); This method of counting lines not works properly when we use "GROUP BY" clause. May be better: $count = \IPS\Db::i()->select( 'count(*)', $this->table, $where, NULL, NULL, $this->group ); //... $count = $count->count(); Thank you in advance.
gudman Posted February 19, 2017 Author Posted February 19, 2017 Finally my solution is: if ( count( $this->group ) ) { $count = $count->count(); } else { $count = $count->first(); }
teraßyte Posted February 20, 2017 Posted February 20, 2017 This looks like a bug, open a ticket in your client area and report it there, if you do the fix will be included in .19 most likely. They don't check this forum as often.
gudman Posted February 20, 2017 Author Posted February 20, 2017 Dear friends, I have no idea how to deal with support because it's not funny :-D I decided to post about this thing there and wait for comment from developers :-)
teraßyte Posted February 20, 2017 Posted February 20, 2017 Well, since this is a bug and bug reports must be made opening a ticket in the client area since a while ago (they closed the public bug tracker, only IPS staff can post there now): https://www.invisionpower.com/clientarea/support/ This forum is to actually ask IPS developers to implement changes in the framework so that us 3rd party developers can access specific areas, data, code and so on. They only check it from time to time and not constantly like tickets.
TSP Posted February 21, 2017 Posted February 21, 2017 13 hours ago, Ryan H. said: This bug also affects my AT&P app. Take one for the team and report it?
bfarber Posted February 21, 2017 Posted February 21, 2017 Someone affected will most likely need to submit a ticket with a specific example.
Jujuwar Posted February 22, 2017 Posted February 22, 2017 20 hours ago, bfarber said: Someone affected will most likely need to submit a ticket with a specific example. @bfarber Done #975542
BomAle Posted February 23, 2017 Posted February 23, 2017 have anyone tested with count(TRUE) and \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS flags?
Aiwa Posted February 24, 2017 Posted February 24, 2017 GROUP_BY will be abandoned for 4.2. Does the workaround noted by Matt resolve the counting issue?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.