[SOLVED] Fatal error on Grid application with active group-by

Greetings. I regenerated the grid applications with scriptcase version 9.10.002 in some situations it returns this error which has never appeared before.

Fatal error: Uncaught Error: Cannot assign an empty string to a string offset in C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\VM_LINUX\grid_mediabatt_146_scriptcase\grid_mediabatt_146_scriptcase_resumo_perdistrib.class.php:8145 Stack trace: #0 C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\VM_LINUX\grid_mediabatt_146_scriptcase\grid_mediabatt_146_scriptcase_grid.class.php(4808): grid_mediabatt_146_scriptcase_resumo->finaliza_arrays() #1 C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\VM_LINUX\grid_mediabatt_146_scriptcase\grid_mediabatt_146_scriptcase_grid.class.php(827): grid_mediabatt_146_scriptcase_grid->totaliza_php_perdistrib() #2 C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\VM_LINUX\grid_mediabatt_146_scriptcase\grid_mediabatt_146_scriptcase_grid.class.php(197): grid_mediabatt_146_scriptcase_grid->inicializa() #3 C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\VM_LINUX\grid_mediabatt_146_scriptcase\index.php(6054): grid_mediabatt_146_scriptcase_grid->monta_grid(0) #4 C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\VM_LINUX\grid_mediabatt_146_scriptcase\index.php(7691): grid_mediabatt_146_scriptcase_apl->controle() #5 {main} thrown in C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\VM_LINUX\grid_mediabatt_146_scriptcase\grid_mediabatt_146_scriptcase_resumo_perdistrib.class.php on line 8145

By inspecting the relevant code in "grid_mediabatt_146_scriptcase_resumo_perdistrib.class.php:8165 "
hangs on the following line:
$this->array_total_bi_datamov[$campo_bi_mio_coddissl][$campo_bi_datamov][$ind_compara][1] = $this->sum_bi_datamov_bi_battute;strong text****strong text

Dear @kkkpe,

We carried out some tests considering:

  • grid created using JOIN;
  • Fields from both tables present in the static and dynamic breakdown, as well as in the summary totalization;
  • finally, calculated virtual field present in the summary totalization and the grid totalization.

No error is returned, either when accessing the grid or when accessing the summary.

Therefore, if possible, send us more details of your application if I have not mentioned them above, so that we can move forward.

We await your return.

Best regards!

I am attaching a zip folder with SQL for creating a test table with related data. I exported the test application where in my case it generates the error. I hope it will be generated by you too and find an immediate solution.scriptcase_error_groupBy.zip (565.9 KB)

Even with version 9.10.003 the problem was not resolved. I have attached the updated project of a test application. Do not fill in the global variable, and click directly on the search button.

I solved the problem with a workaround, you need to modify the file grid_mediabatt_146_scriptcase_resumo_perdistrib.class.php by adding the check if string is empty:

$this->sum_bi_datamov_bi_battute = $this->sum_bi_datamov_bi_battute==’’?0:$this->sum_bi_datamov_bi_battute;
$this->array_total_bi_datamov[$campo_bi_mio_coddissl][$campo_bi_datamov][$ind_compara][1] = $this->sum_bi_datamov_bi_battute;

			 $this->sum_bi_datamov_battutefatte = $this->sum_bi_datamov_battutefatte==''?0:$this->sum_bi_datamov_battutefatte;
			 
			 $this->sum_bi_datamov_battutefatte = $this->sum_bi_datamov_battutefatte==''?0:$this->sum_bi_datamov_battutefatte;
             $this->array_total_bi_datamov[$campo_bi_mio_coddissl][$campo_bi_datamov][$ind_compara][2] = $this->sum_bi_datamov_battutefatte;
             
			 **$this->sum_bi_datamov_media = $this->sum_bi_datamov_media == ''?0:$this->sum_bi_datamov_media;**
             $this->array_total_bi_datamov[$campo_bi_mio_coddissl][$campo_bi_datamov][$ind_compara][3] = $this->sum_bi_datamov_media;
			 $this->sum_bi_datamov_copiamedia = $this->sum_bi_datamov_copiamedia==''?0:$this->sum_bi_datamov_copiamedia;
             $this->array_total_bi_datamov[$campo_bi_mio_coddissl][$campo_bi_datamov][$ind_compara][4] = $this->sum_bi_datamov_copiamedia;

scriptcase_error_groupBy.zip (572.4 KB)

I hope this finally makes you understand the problem

Thanks for your feedback, @kkkpe.

We were able to reproduce the error in your application, and the problem has already been reported to the development team.

Any news about the release of the fix, I will be giving feedback through this thread.

Best regards!

Hi everybody!

As I reported when I updated to version 9.10, I have the same problem and any grid with the group by option fails.

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

This error causes some problems for our customers. Can we speed up the update? Thank you

Dear,

A fix was released in version 9.10.005 for the bugs reported in this topic.

Please check your applications and give us feedback as soon as possible.

Best regards!

1 Like

ok. now it works fine. Thank you

Hi everybody!

I am not agree. It do not work fine. Now totals disappears if you use a virtual field when grouping…
There is another discussion on this…

Hello everyone,

After this update, when grouping, anything you type to an onGroupByAll event will cause the GroupBy totals to disappear because their values ​​become NULL.

Please, I’m waiting for a fix since the release of Scriptcase 9.10.

First, virtual fields were failing and showing the fatal error above when using virtual fields. Now I can’t type anything on an OnGroupBy event with any type of field (virtual or not). In fact, if you type a simple “echo ({sum_groupby_field});”, the totals disappear too.

This is very annoying, especially the lack of response from the scriptcase team. It has been 3 months since my first request for help.

Thank you.

1 Like

Dear @ajhernan,

A case related to the disappearance of totals when using {sum_groupby} in groupby was reported and corrected to be released in the next version to come.

As soon as it is released, we will be giving feedback through this thread.

We apologize for the inconvenience and thank you for your cooperation.

Best regards!

Dear @ajhernan,

The reported issue has been fixed and released in version 9.10.010.

Best regards!

Hi Danilo!
Now “group by” functionality it’s ok
thanks a lot for your help!!