This topic is locked

3.1 (143) false behavior with beforeEdit-Event

8/29/2006 3:00:00 PM
PHPRunner General questions
Pfeiffer author

Hi,
although my function BeforeEdit returns false the user get the message

Record saved (in German : Datensatz aktualisiert)???
$retval=true;

if(function_exists("BeforeEdit"))

$retval=BeforeEdit($evalues,$strWhere);

if($retval)

{

// construct SQL string

foreach($evalues as $ekey=>$value)

$strSQL.=AddFieldWrappers($ekey)."=".add_db_quotes($ekey,$value).", ";

if(substr($strSQL,-2)==", ")

$strSQL=substr($strSQL,0,strlen($strSQL)-2);

$strSQL.=" where ".$strWhere;

$strSQL = AddWhere($strSQL,SecuritySQL("Edit"));

db_exec($strSQL,$conn);

// delete & move files

foreach ($files_delete as $file)

@unlink($file);

foreach ($files_move as $file)

move_uploaded_file($file[0],$file[1]);

// after add event

if(function_exists("AfterEdit"))

AfterEdit();

}

$message="<div class=message><<< "."Datensatz aktualisiert"." >>></div>";
I think $message must be within the if clause...
Best regards

Uwe Pfeiffer

Alexey admin 8/31/2006

Uwe,
thank you for pointing me to this bug.

We'll fix it in the next update of PHPRunner