SC 9 - Invalid argument supplied for foreach()

SC 9 -

Invalid argument supplied for foreach() /opt/NetMake/v9/wwwroot/scriptcase/devel/generator/nm_gp_grafico_histograma.php 456

I am getting this error message while generation applications containing histograms.
The applications were imported from SC 8 and in SC 8 such error message did not show up.

Hello,

Analyzing the error line, the problem occurred in the parameters received in the foreach to ride summary with the sorting fieldsg each group by. Could you send some images of your application settings?

Hello,
we also have the same error in grid app but in database.inc.php. The database used is Postgresql and all works in sc8

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