In an afterInsert event, I provide the following code:
if( sc_changed( {Gravity_Factor} ) ) {
$gravity_factor = sc_sql_injection({Gravity_Factor});
$sql .= "Gravity_Factor";
$sqlv .= "'".$gravity_factor."'";
}
That produces this generated code:
if($this->nmgp_dados_form['gravity_factor'] != $this->gravity_factor ) {
[B]$this->gravity_factor[/B] = $this->Db->qstr($this->gravity_factor );
$sql .= "Gravity_Factor";
$sqlv .= "'".[B]$gravity_factor[/B]."'";
}
Which produces a runtime error because $gravity_factor is undefined, because it has not been explicitly scoped to the class.
There are a number of potential errors made likely here, because ScriptCase does not preserve the variable name case. Ouch!
But it’s the scoping issue that I’m reporting, which looks like a string parsing problem for the event code.