Invalid argument supplied for foreach()

Hello,
we converted a project from 8 version and we always have this error when generate a grid app

2 = Invalid argument supplied for foreach()
/opt/NetMake/v9/wwwroot/scriptcase/devel/lib/php/database.inc.php 827

the database is postgresql.

The app is ok in v8

Thank you
Maurizio