I am having a Webform where I need to programmatically use all data the user has input in the webform but without saving submissions.
In the webform settings, there is a setting about Disable saving of submissions but when I use the below function in my CustomHandler:
public function submitForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {
//...
}
this setting will become disabled with a message: This webform's submission handlers requires submissions to be saved to the database.
What function should I use in order to disable saving submission to the database ?
Thank you,
Comments
Comment #2
jrockowitz commentedI am not completely following your question.
In your custom handler, you can set
results = \Drupal\webform\Plugin\WebformHandlerInterface::RESULTS_PROCESSED,in the plugin's annotation.Comment #3
c.e.a commentedBelow is my CustomHandler.php file:
But if I visit the webform settings:
/admin/structure/webform/manage/test_webform/settingsI will find:
Why I cannot Check [x] Disable saving of submissions ?
Comment #4
c.e.a commentedComment #5
jrockowitz commentedYou need to remove the
submission = \Drupal\webform\Plugin\WebformHandlerInterface::SUBMISSION_REQUIRED,from the handler annotation.Comment #6
c.e.a commentedThank you, it worked