Jump to content

\IPS\Helpers\Table\Db group by paginator issue (?)

Featured Replies

Posted

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.

  • Author

Finally my solution is:

		if ( count( $this->group ) )
		{
			$count		= $count->count();
		}
		else
		{
			$count		= $count->first();
		}

 

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.

This bug also affects my AT&P app.

  • Author

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 :-)

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.

13 hours ago, Ryan H. said:

This bug also affects my AT&P app.

Take one for the team and report it? :p

 

Someone affected will most likely need to submit a ticket with a specific example.

20 hours ago, bfarber said:

Someone affected will most likely need to submit a ticket with a specific example.

@bfarber Done #975542

have anyone tested with count(TRUE) and \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS flags?

GROUP_BY will be abandoned for 4.2.  Does the workaround noted by Matt resolve the counting issue?

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.