Parse error: Syntax error on Summary

Hi all,

I’m using a Grid consulting a View. When I click on summary, I get this

Parse error: syntax error, unexpected 'B' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'B' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'B' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle\grid_vwconsultadetalle_total.class.php(563) : eval()'d code on line 13 Parse error: syntax error, unexpected 'I' (T_STRING) in C:\Dev\NetMake\v71\wwwroot\v8\app\koGest\grid_vwconsultadetalle
...
and continue a lot...
....

Looking into generated source, affected code is this:

536|              $arr_name   = "array_total_" . $cmp_gb . $contr_arr;
537|             eval ('
538|              if (!isset($' . $arr_name . '))
539|              {
540|                  $' . $arr_name . '[0] = ' . $registro[0] . ';
541|                  $' . $arr_name . '[4] = ' . $registro[1] . ';
542|                  $' . $arr_name . '[5] = ' . $registro[2] . ';
543|                  $' . $arr_name . '[6] = ' . $registro[3] . ';
544|                  $' . $arr_name . '[7] = ' . $registro[4] . ';
545|                  $' . $arr_name . '[2] = ' . $registro[5] . ';
546|                  $' . $arr_name . '[3] = ' . $registro[6] . ';
547|                  $' . $arr_name . '[1] = ' . $registro[7] . ';
548|                  $' . $arr_name . '[8] = $val_grafico_' . $cmp_gb . ';
549|                  $' . $arr_name . '[9] = "' . $$temp . '";
550|              }
551|              else
552|              {
553|                  $' . $arr_name . '[0] += ' . $registro[0] . ';
554|                  $' . $arr_name . '[4] += ' . $registro[1] . ';
555|                  $' . $arr_name . '[5] += ' . $registro[2] . ';
556|                  $' . $arr_name . '[6] = max($' . $arr_name . '[6], ' . $registro[3] . ');
557|                  $' . $arr_name . '[7] = min($' . $arr_name . '[7], ' . $registro[4] . ');
558|                  $' . $arr_name . '[2] += ' . $registro[5] . ';
559|                  $' . $arr_name . '[3] = min($' . $arr_name . '[3], ' . $registro[6] . ');
560|                  $' . $arr_name . '[1] += ' . $registro[7] . ';
561|              }
562|             ');
563|          }
564|       } 

This is the autogenerated code, not my own.

Somebody imagines what can be the problem?

I think it is caused by the two $ signs in line 549.
I have had similar effects because SC sometimes (very rare though) and for no obvious reason, creates an empty php method which causes all sorts of problems.
Have a look there and if there is one, delete it and all will be fine.
Just an idea.

jsb

Good caught JSB, I didn’t saw it. But I think is not this.

Problem comes just If i group by name.
I think is a character encoding problem. I looked to a customer who contains a " ’ " symbol. I changed, and then error changed too. Now I think is related to some characters not recognized.

It’s curious, Once I group by, if I group by Date all is ok but fails grouping by name, but it’s curious because seems something changes because can’t see special chars.

Group by Date all ok

Group by Name, all “crash”. In summary, customers with ? like Ca?izares, appears CAÑIZARES

But don’t understand. Prior to summary, in grid, all looks ok

Captura.JPG

Captura2.JPG

Problem was solved on 031 or 032 if I remember correctly, but I think is broken again. I’m having problems again trying to sumarize a grid with ’ characters.

:frowning:

Giu,

as a workaround I creates SQL views with calculated fields that strips\substitute the ’ character and use these calculated (“safe”) fields in the SC summary.
These views have both the original (with the ’ char) and the “safe” ( ’ is stripped\substituted) version of the original fields.
So within the same grid I use the safe version of fields only where SC is not stable (e.g. summary) and the original fields everywhere else.

Of course this is not feasible if you don’t want or cannot have “Sant’Angelo” changed to “SantAngelo” or “Sant-Angelo” in your summary for example.

Furthermore it can be a lot of work and may impact performance as well.

These type of bugs really hurts the trust I have in SC as a professional tool…

[QUOTE=robydago;33861]Giu,

as a workaround I creates SQL views with calculated fields that strips\substitute the ’ character and use these calculated (“safe”) fields in the SC summary.
These views have both the original (with the ’ char) and the “safe” ( ’ is stripped\substituted) version of the original fields.
So within the same grid I use the safe version of fields only where SC is not stable (e.g. summary) and the original fields everywhere else.

Of course this is not feasible if you don’t want or cannot have “Sant’Angelo” changed to “SantAngelo” or “Sant-Angelo” in your summary for example.

Furthermore it can be a lot of work and may impact performance as well.

These type of bugs really hurts the trust I have in SC as a professional tool…[/QUOTE]
Can you share how you strip this char?
I will try

This will remove the ’ in mysql:

SELECT
       tablename.field1 AS field1,
       REPLACE(tablename.field1,'\'','') AS field1_safe,
       ....

don’t know if the syntax is standard.