I have the following entry_submission_ready method in an extension to update a field's data. This works fine when saving an entry in the control panel, but it doesn't change the field value on the front end using Channel Form. The function is called, because I can output $data to the screen.
function entry_submission_ready($meta, $data, $autosave)
{
$data['field_id_281'] = 'Test';
if(isset($this->EE->api_sc_channel_entries))
{
$this->EE->api_sc_channel_entries->data = $data;
}
else
{
$this->EE->api_channel_entries->data = $data;
}
}
It seems $this->EE->api_channel_entries->data is empty on the front end, but is used in the control panel. So what would one use to save the data on the front end using Channel Form?