[SOLVED] Error in PHP generation due to "character"

Since 2 days ago, I saw a strange behaviour, important to take into consideration and solve ASAP.

For example, look at this code. It’s a code on a onExecute event from a Blank app. (I extracted from sc_tbevt -> Field Codigo from SC database, to get exactly the text saved)


function cargaDepartamentos(){
	$ruta_imagenes = $_SESSION['scriptcase']['TPV']['glo_nm_path_imagens'] . "/departamentos/";
	
	$consulta = "SELECT * FROM departamentos";
	
	sc_lookup(datos, $consulta);
	$estructura='';
	
	foreach({datos} as $indice => $fila){
		if ($fila[2]!='') {
			$imagen = '<img src="'.$ruta_imagenes.$fila[2].'"height=75px width=75px><br>';
		} else {
			$imagen = '';
		}
		$estructura .= '<a href=# onclick="cargaProductos('.$fila[0].');return false;"><div class="cajasombra departamentos" style="background-color:'.$fila[3].'">'. $imagen .'<p class="texto-vertical-align">'. $fila[1].'</p></div></a>';
	}
	echo $estructura;
}

Code it’s ok, nothing wrong, any syntax file and so on. All “perfect”. But on generation we got weird errors, and looking into PHP generated file, this is what I got in the foreach loop. Just, inside foreach …

     foreach($datos  as $indice => $fila){ 
         if$this->SC_function_0($fila[2]!='') { // <--------- $this->SC_function_0 ???? WTH?
     $this->SC_function_0  $imagen = '<img src="'.$ruta_imagenes.$fila[2].'"height=75px width=75px><br>';  // <--------- $this->SC_function_0 ???? WTH?
         } else { 
     $this->SC_function_0  $imagen = ''; // <--------- $this->SC_function_0 ???? WTH?
         } 
 
         $estructura .= '<a href=# onclick="cargaProductos('.$fila[0].');return false;"><div class="cajasombra departamentos" style="background-color:'.$fila[3].'">'. $imagen .'<p class="texto-vertical-align">'. $fila[1].'</p></div></a>'; 
     } 

To solve it, I had to delete previous TABS, and do a intro again and then it solved, but I got a lot of lines like this in the generation. On SC database all is ok, with TABS, no strange spaces, and so on…

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann

Hello,

could you please explain this problem better? And more detail still as you solved the same.

Thank you!

I Have the same issue, lots of "$this->SC_function_0 " in generated code. Any idea to solve this? Thanks!

Hi Giu,

Have you tried to make a Scriptcase method? Instead of a function on blank event.

Hi Caio,

Didn’t tried because because is not an external function on a blank, is a blank full of code, and this is one of the functions inside

’ problem

Hi

This is an Old Old Old problem on all release the " ’ " have always done a code generation problem randomly

regards

Hi Giuseppe,

I have tried to perform the case, but I couldn’t. I did the folowing code on blank event:

function teste()
{
    $arr = array('host' => '127.0.0.1', 'user' => 'root', 'pass' => 'teste');
    
    foreach($arr as $key => $value)
    {
        echo $key . ": " . $value . "<br />";
    }
}

teste();

The application was executed normally. Do I need to make anything to get the error?

Hello,

Do you any news about this problem?

[QUOTE=John L. Santos;35969]Hello,

Do you any news about this problem?[/QUOTE]

For me, this just didn’t happened again.

Hello,

Maybe this problem has been fixed from other fixes.
I will for this thread as solved by now, but if the problem occurs again, I ask you to inform us.