HuasoFoundries/phpPgAdmin6

Warnings when Browsing without Explicit Page/Offset

klaxian opened this issue · 3 comments

The following warnings when are displayed when browsing/searching. This affects both PHP 7.2 and 7.4, PG 10 and 12. debugmode is false.

Warning: array_keys() expects parameter 1 to be array, null given in /var/www/phppgadmin-hf/src/controllers/DisplayController.php on line 139
Warning: Invalid argument supplied for foreach() in /var/www/phppgadmin-hf/src/database/ADOdbBase.php on line 140
Warning: sizeof(): Parameter must be an array or an object that implements Countable in /var/www/phppgadmin-hf/src/database/Postgres.php on line 841

This is a different problem from issue #245, but it might be related to the fix for that issue.

It looks like this only happens when first clicking the "Browse" tab (before a page/offset is explicitly chosen). I suspect a variable is expected that is only set when $_GET['page'] exists.

You mean when you just click the "browse" button? I guess I broke it when I fixed the pagination issue. Anyway, I just defaulted the missing parameters to empty arrays, which is ok since browsing is meant to be just a "SELECT * "