1

I have just updated EE to 2.7.1 and see that Safecracker is now changed to Channel Form.

I have an extension which runs on submission end so have had to change the hook to the new hook for channel form.

The problem is, I am unable to get the submitted information as I did before.

Here is the top of my function, with the hook changed over.

public function channel_form_submit_entry_end($cf)
{       
    $entry_id = $cf->entry['entry_id'];
    $member_id = $cf->entry['author_id'];

How do you now go about getting submitted information, as the following isnt working.

$cf->entry['entry_id'];

Thank you.

3

Try this inside your hook:

print_r($cf); exit();

This will let you inspect the structure of the object passed by the hook, and find where entry_id lives.

1

I am fairly new to EE, but did implement the same channel_form_submit_entry_end($channel_form_obj) hook. But I do not believe this hook passes any data to the function, just the channel form object. The other 2 channel form hooks do, however, appear to pass data via the $tagdata as noted in the docs. channel_form_entry_form_tagdata_start($tagdata, $channel_form_obj), channel_form_entry_form_tagdata_end($return_tagdata, $channel_form_obj).

Allow me add my own correction.

I found a way to access the form entries using $_POST in this answer.

function channel_form_submit_entry_start($form_obj)

$data=$_POST['title'];

// do something with $data now echo $data //change the data public function safecracker_submit_entry_start()

{ $_POST['news_body'] = 'Test'; }

0

I'm late but i checked the post data using.. ee()->input->post( 'YOUR-POST-VARIABLE', TRUE );

But I'm using EE 3.x.x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.