1.0 Problem/Motivation
Webform CiviCRM Integration breaks Webform draft
Error: Call to a member function getFormObject() on null in wf_crm_webform_postprocess->submissionValue() (line 2551 of /path/web/modules/contrib/webform_civicrm/includes/wf_crm_webform_postprocess.inc)
#0 /path/web/modules/contrib/webform_civicrm/includes/wf_crm_webform_postprocess.inc(580): wf_crm_webform_postprocess->submissionValue('civicrm_2_conta...')
#1 /path/web/modules/contrib/webform_civicrm/includes/wf_crm_webform_postprocess.inc(165): wf_crm_webform_postprocess->getExistingContactIds()
#2 /path/web/modules/contrib/webform_civicrm/src/Plugin/WebformHandler/CivicrmWebformHandler.php(145): wf_crm_webform_postprocess->preSave(Object(Drupal\webform\Entity\WebformSubmission))
#3 /path/web/modules/contrib/webform/src/Entity/Webform.php(2707): Drupal\webform_civicrm\Plugin\WebformHandler\CivicrmWebformHandler->preSave(Object(Drupal\webform\Entity\WebformSubmission), NULL, NULL)
#4 /path/web/modules/contrib/webform/src/WebformSubmissionStorage.php(1210): Drupal\webform\Entity\Webform->invokeHandlers('preSave', Object(Drupal\webform\Entity\WebformSubmission), NULL, NULL)
#5 /path/web/modules/contrib/webform/src/WebformSubmissionStorage.php(974): Drupal\webform\WebformSubmissionStorage->invokeWebformHandlers('preSave', Object(Drupal\webform\Entity\WebformSubmission))
#6 /path/web/modules/contrib/webform_encrypt/src/WebformEncryptSubmissionStorage.php(244): Drupal\webform\WebformSubmissionStorage->doPreSave(Object(Drupal\webform\Entity\WebformSubmission))
#7 /path/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(454): Drupal\webform_encrypt\WebformEncryptSubmissionStorage->doPreSave(Object(Drupal\webform\Entity\WebformSubmission))
#8 /path/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(837): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\webform\Entity\WebformSubmission))
2.0 Detailed steps to reproduce (embed screenshots)
Create a Webform
Activate draft & check working
Enable CiviCRM Processing
Draft stop working
Comments
Comment #2
andrimont commentedComment #3
andrimont commentedI noticed that there is similar error when using the "previous page" button.
Comment #4
aayushdahal commentedI will try to reproduce this issue and get back to you!
Comment #5
aayushdahal commented@andrimont
(Screenshots attached)
As per your reproduction step "Activate draft & check working"; I went to Submission Settings -> Submission Draft Settings -> Allow your users to save and finish the webform later -> and then checked off the radio button "Authenticated and anonymous users.
After this step, a "Save Draft" button appeared in my webform, and when I press it, I do get an error:
Error: Call to a member function getFormObject() on null in Drupal\webform_civicrm\WebformCivicrmPostProcess->submissionValue() (line 2670 of /var/www/drupal/web/sites/default/modules/webform_civicrm/src/WebformCivicrmPostProcess.php)
Comment #6
aayushdahal commented@andrimont
Please let me know if my reproduction for the issue was how you did it, if not, please let me know how you did the step "Active draft & check working".
Comment #7
aayushdahal commentedComment #8
karingHi @petednz - would this be functionality that is important to Fuzion? We really don't use this - but happy to ask J to put some time into it if you do.
Comment #9
karingComment #10
jitendrapurohit commentedFixed at https://github.com/colemanw/webform_civicrm/pull/592
Comment #11
jitendrapurohit commentedComment #12
karing@andrimont - my team has reproduced, fixed issue and will also test the PR [@aayushdahal - could you please add PR 592 to your list?]
Please note that for we will be starting to prioritize active community member requests - please see https://www.drupal.org/project/webform_civicrm for ways to contribute back/get involved.
Comment #13
aayushdahal commented@KarinG Will do!
Comment #14
andrimont commentedHello all,
Thanks you @jitendrapurohit, @KarinG and @aayushdahal
In a D9 site, I still get the error using the Draft :
Error: Call to a member function getFormObject() on null in Drupal\webform_civicrm\WebformCivicrmPostProcess->submissionValue() (line 2670 of modules/contrib/webform_civicrm/src/WebformCivicrmPostProcess.php)..Comment #15
karingDid you pull in PR 592? Did you clear caches?
We will still test this manually but the PR we added includes an automated test that is passing on 3 Drupal/CiviCRM combinations, including D9.
Comment #16
karingWe have manually tested https://github.com/colemanw/webform_civicrm/pull/592 - and it is now merged.
Comment #17
karing