I have created an extension to manipulate saved data when an entry is saved. I can't get this to work using entry_submission hooks, I cannot find that much information about this online. I believe I need to use entry_submission_ready.

Does anyone know why this does not work when I save an entry?

function entry_submission_ready($entry_id,$meta, $data) {$data['field_id_123'] = '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; } }  The hook IS being called because I can output$data to the screen (print_r) and can see the value of the field I have set in the $data array. But this is not saved to the entry. I have also tried$this->EE->api_channel_entries->data['revision_post'] and entry_submission_ready. None work.

EE 2.7.2

Thanks

Initially I used entry_submission_end($entry_id,$meta, $data), but realised I needed entry_submission_ready. I overlooked the fact entry_submission_ready uses different arguments, its ($meta, $data,$autosave) and not ($entry_id,$meta, \$data)!