[SOLVED] Group By fails after scriptcase 9.10 update

Hi!

After the latest scriptcase update, the “group by” on grids option fails with ad hoc created fields used on grid totals or summary totals.

I load these fields on the onRecord event using sc_lookup:

$sql="SELECT state, count(*), COALESCE( SUM( ROUND( weight::numeric, 1)), 0) FROM...";
sc_lookup(dataset,$sql);

$state= {dataset[0][0]};
{count}= {dataset[0][1]};
{weight}= {dataset[0][2]};

As you can see, all of these fields values are always >= 0
The error message that I get is: “Error: Cannot assign an empty string to a string offset”.
This was fully working until the last update.

Could you fix it, pleased

Thanks…

Dear @ajhernan,

Could you please send us your application where this error started to occur after the update?

If possible, send it to us via email (bugs@scriptcase.net), so that we can try to simulate and report the problem, if the bug in the tool is confirmed.

We await your return.

Best regards!

Hi Danilo!

You can reproduce the bug by creating a grid with a group By.
The problem occurs when you try to modify a total group by through the onGroupBy event. For example to calculate a total percent.

if( {sum_groupby_field2}){
{sum_groupby_field3}= 100*{sum_groupby_field1}/{sum_groupby_field2};
}
else{
{sum_groupby_field3}= 100*{sum_groupby_field1}/{sum_groupby_field2}
}

This fails and report the message “Error: Cannot assign an empty string to a string offset”

Thanks

Thanks for your return with more details, @ajhernan.

Using the same example you described above, no error was returned in the grid, and the totals group by were modified normally.

I suggest you contact Scriptcase support (support@scriptcase.net) to check in more detail about the error occurring in your application.

Best regards!

tengo los siguientes errores

Undefined array key “tot_res_linha_visu_campo_align”
Undefined variable $groupByNameToUse

estos se presentaron al compilar una aplicacion que tienen resumen.
Realice un nuevo reporte usando la grilla y el mismo resultado

Hi Danilo!

I’ve just make an new installation of Scriptcase 9.10 from the scratch. This time I use a Windows 11 with postgres. I create a grid app with a group by and I get the same error when I try to modify total values on the onGroupBy event.

Really, this is a bug. Could you fix it!!

Hi!

I’ve sent a few emails to support and error emails explaining the error, but at the moment, I have no idea if anyone is considering fixing it.

I have identified that the error occurs whenever calculated fields are used in groups. In this case you cannot write anything to the onGroupBy event.

Can you fix this error? I have a lot of reports that use this functionality that now fail and I can’t update anything.

This is very annoying and prevents me from continuing development as it invalidates critical dashboard reports.

Thank you so much.

I’m also having an issue with the event group by calculations. It seems not be not setting the values for OnGroupByAll or any group your create. Scriptcase DEV team please look into this as I also have many reports that are now not working do to the grid grouping code changes.

Dear,

I ask that you send your applications to (bugs@scriptcase.net) so that we can analyze in more detail the specifics contained in your applications, as so far we have not been able to reproduce the errors mentioned following the characteristics informed in this topic.

We await your feedback so we can move forward.

Best regards!

Sigo con el mismo problema con la actualización 9.10.2.17 si podrían solucionar.

(http://127.0.0.1:8092/scriptcase/devel/conf/scriptcase/img/ico/document_error_16.png)
Tipo: Grid
2 = Undefined variable $groupByNameToUse

C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\devel\generator\nm_gp_resumo_info.php 429
2 = Undefined variable $groupByNameToUse
C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\devel\generator\nm_gp_resumo_info.php 429
2 = Undefined variable $groupByNameToUse
C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\devel\generator\nm_gp_resumo_info.php 429|

Hi Danilo

The bug continues. All the summary reports are affected. This is really a disaster and I do not have any solution yet.

Fatal error: Uncaught Error: Cannot assign an empty string to a string offset in /opt/NetMake/v9-php81/wwwroot/scriptcase/app/hummingbird/grid_cumplimiento_disponibilidad_detallado/grid_cumplimiento_disponibilidad_detallado_resumo_por_producto.class.php:11275 Stack trace: #0 /opt/NetMake/v9-php81/wwwroot/scriptcase/app/hummingbird/grid_cumplimiento_disponibilidad_detallado/grid_cumplimiento_disponibilidad_detallado_grid.class.php(13944): grid_cumplimiento_disponibilidad_detallado_resumo->finaliza_arrays() #1 /opt/NetMake/v9-php81/wwwroot/scriptcase/app/hummingbird/grid_cumplimiento_disponibilidad_detallado/grid_cumplimiento_disponibilidad_detallado_grid.class.php(1242): grid_cumplimiento_disponibilidad_detallado_grid->totaliza_php_por_producto() #2 /opt/NetMake/v9-php81/wwwroot/scriptcase/app/hummingbird/grid_cumplimiento_disponibilidad_detallado/grid_cumplimiento_disponibilidad_detallado_grid.class.php(264): grid_cumplimiento_disponibilidad_detallado_grid->inicializa() #3 /opt/NetMake/v9-php81/wwwroot/scriptcase/app/hummingbird/grid_cumplimiento_disponibilidad_detallado/index.php(5045): grid_cumplimiento_disponibilidad_detallado_grid->monta_grid(0) #4 /opt/NetMake/v9-php81/wwwroot/scriptcase/app/hummingbird/grid_cumplimiento_disponibilidad_detallado/index.php(7519): grid_cumplimiento_disponibilidad_detallado_apl->controle() #5 {main} thrown in /opt/NetMake/v9-php81/wwwroot/scriptcase/app/hummingbird/grid_cumplimiento_disponibilidad_detallado/grid_cumplimiento_disponibilidad_detallado_resumo_por_producto.class.php on line 11275

Thanks

1 Like

Hi Danilo!

Today, the scriptcase team released update 9.10.005.
This update says that the “Fatal error: Uncaught Error: Cannot assign an empty string to a string offset” issue has been fixed when running some query applications in PHP 8.1 environments. And it is true, this message no longer appears. Maybe it is because now, groupings do not work when with virtual fields.

If you simple sum a virtual field, totalization fails and do not show anything.

Dear @ajhernan,

We carried out some tests here considering the scenario you described, but we did not identify any problems either in totalizing the query or in totalizing the summary.

We create a virtual field, and in the application’s onRecord event, we add two fields from the database and assign them to the created virtual field.

When you define this virtual field in the query or summary totalization, the values ​​are displayed normally and are displayed correctly.

Is there any other detail that I did not provide here above that is part of your application and that must be taken into account to be able to simulate the problem? If there is, please give us feedback so that we can simulate it.

Best regards!

Hi Danilo

I have sent an email with a screencastify screen capture to bugs@scriptcase.net and to support@scriptcase.net showing the bug. Please, I have this problem since Scriptcase 9.10 first update…

Thanks.

Dear @ajhernan,

Please let us know which email address you contacted us at, and what day it was, so that we can find the email.

We await your return.

Best regards!

Hi Danilo!

Today, from ajhernan@coit.es to bugs@scriptcase.net and to support@scriptcase.net.
Thanks

Hello everyone!

I think the scriptcase team must be working on fixing this bug.
This error is critical because it affects many of my reports.

The fact is that at the moment I cannot update my grid applications to improve their functionality or for any other reason.

Please I need you to resolve this error. It’s been happening since the Scriptcase 9.10 update, more than a month ago.

Thanks in advance.

Hello Danilo!
After 2 months this bug still hasn’t been fixed and it’s a big problem for me.
I would like to know if the solution is on the way and what is the estimated time to resolve it.
I need to add other important functionality to multiple grids and need to decide whether to look for an alternative solution to provide it.
I appreciate your cooperation.
Thank you.

Hi every body!
Since 9.10.010 update, “group by” functionality now it’s ok.

Thanks a lot for your help!!