No idea if this is a bug in the 5.20 version but I cannot do a simple calculation in a hook file.
My table is called calculations
My fields are:
units
end_reading
start_reading
in the hook/calculations.php file I did:
Code: Select all
function calculations_before_insert(&$data, $memberInfo, &$args){
$data['calculations.units'] = $data['calculations.start_reading'] * $data['calculations.end_reading'];
return TRUE;
}
Code: Select all
function calculations_before_insert(&$data, $memberInfo, &$args){
$data['units'] = $data['start_reading'] * $data['end_reading'];
return TRUE;
}
This did not work either, any idea why please? I have followed the help files correctly I believe.
Thank you,
Ben