I'm wanting to use Freeform Next's 'save to database' feature as an option given to the user but I'm not sure if this is possible.

The form is set to not store data by default but I'd like to enable this should a user select a checkbox on the form. I've created an extension with the following hook.

public function form_before_submit($form)
{
    if (ee()->input->post('consent'))
    {
        $form->storeData = TRUE;
    }
}

But I receive this error message:

Fatal error: Cannot access private property Solspace\Addons\FreeformNext\Library\Composer\Components\Form::$storeData

I can see the $storeData class property is set to private, hence the error, so is there a way around this?

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.