I am attempting to set the values of some TVs via a post or pre hook on a login register call - but i get server error page when it processes the snippet... Can anyone tell me why this is not working?
// get values from qualification, project and account forms
$qualificiation_areyou = $hook->getValue('qualificiation_areyou');
$qualificiation_emailaddress = $hook->getValue('qualificiation_emailaddress');
// set TVs to values as per form data
$projectFolderID = 19;
$doc = $modx->getObject('modDocument',$projectFolderID);
$doc->setTVValue(32, $qualificiation_areyou);
$doc->setTVValue(33, $qualificiation_emailaddress);
return true;
So, I am getting the form field values of fields "qualificiation_areyou" and "qualificiation_emailaddress" in the snippet, then defining the modx resource I want to set the TVs on - e.g. id=19, then setting the TVs (e.g. 32 and 33) to the values of the form fields "qualificiation_areyou" and "qualificiation_emailaddress" respectively...
Why is this not working??