[TYPO3] Hook doesn't work
Georg Ringer
mail-spam at ringerge.org
Wed Mar 29 13:00:03 CEST 2006
Hello,
I wanted to write a small HowTo but it doesn't work as I thought because
the new data isn't written into the DB.
Explanation: There is a dropdown with tt_address-records and a checkbox
'import'.
If checkbox (row[ttaddresscheck) is activated, the own record should get
updated with
$fieldArray['name']= $row2['name'];
but this doesn't work :/
Of course I could use the Update-function but I thought this isn'
neccessary.
Can somebody please help me?
thx!
georg
PS: Here is the hook:
<?php
class tx_rghook_tcemainprocdm {
function processDatamap_postProcessFieldArray ($status, $table, $id,
$fieldArray, $this) {
if ($table == 'tx_rghook_person' && $status== 'update') {
global $TYPO3_DB;
$tables = "tx_rghook_person";
$fields = "uid, ttaddress, ttaddresscheck, name, email";
$temp_where='uid = '.$id;
$res = $TYPO3_DB->exec_SELECTquery($fields, $tables, $temp_where);
$row = $TYPO3_DB->sql_fetch_assoc($res);
if ($row[ttaddresscheck] == 1) {
$tables = "tt_address";
$fields = 'name, email';
$temp_where='uid = '.$row[ttaddress];
$res2 = $TYPO3_DB->exec_SELECTquery($fields, $tables, $temp_where);
$row2 = $TYPO3_DB->sql_fetch_assoc($res2);
$fieldArray['name']= $row2['name'];
$fieldArray['email']= $row2['email'];
# Update
#$update = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_rghook_person',
'uid='.$id , $fieldArray);
#mysql_query($update);
} // $row[ttaddresscheck] == 1
} // $table == 'tx_rghook_person' && $status== 'update'
}
}
?>
More information about the TYPO3-english
mailing list