I have a hook_node_presave implementation to set the value of a node field based on one of the user-entered values.
The code for it looks like this:
function er_pr_node_presave($node) {
.....
foreach($nameResult as $row) {
$node->field_co_pi[LANGUAGE_NONE][$i]['value'] = intval($row->entity_id);
}
dpm($node);
}
With the dpm function I can see the values in the node, and the correct value is set to the field_co_pi field. However, the placeholder field doesn't get set when the insert query for that custom field is ran, resulting in a PDOException: