"getContextId() must be of the type string" error when "Disable saving of submissions" is selected

Created on 13 March 2023, over 1 year ago
Updated 27 August 2024, 3 months ago

Using the mollie_webform submodule: When in the General Webform settings (/admin/structure/webform/manage/*/settings) the checkbox "Disable saving of submissions" is checked there is a fatal error on submission.
getContextId(), which is supposed to give the submission_id is in this case empty, but expected to give a value.

TypeError: Return value of Drupal\mollie\Entity\TransactionBase::getContextId() must be of the type string, null returned in Drupal\mollie\Entity\TransactionBase->getContextId() (regel 147 van /modules/contrib/mollie/src/Entity/TransactionBase.php)

#0 /modules/contrib/mollie/src/Entity/PaymentStorage.php(74): Drupal\mollie\Entity\TransactionBase->getContextId()
#1 /modules/contrib/mollie/src/Entity/TransactionStorageBase.php(239): Drupal\mollie\Entity\PaymentStorage->createTransactionFromEntity(Object(Drupal\mollie\Entity\Payment))
#2 /core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(721): Drupal\mollie\Entity\TransactionStorageBase->doSaveFieldItems(Object(Drupal\mollie\Entity\Payment))
#3 /core/lib/Drupal/Core/Entity/EntityStorageBase.php(520): Drupal\Core\Entity\ContentEntityStorageBase->doSave(NULL, Object(Drupal\mollie\Entity\Payment))
#4 /core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\mollie\Entity\Payment))
#5 /modules/contrib/mollie/modules/mollie_webform/src/Plugin/WebformHandler/MolliePaymentHandler.php(139): Drupal\Core\Entity\EntityBase->save()
#6 /modules/contrib/webform/src/Entity/Webform.php(2757): Drupal\mollie_webform\Plugin\WebformHandler\MolliePaymentHandler->confirmForm(Array, Object(Drupal\Core\Form\FormState), Object(Drupal\webform\Entity\WebformSubmission))
#7 /modules/contrib/webform/src/WebformSubmissionForm.php(1919): Drupal\webform\Entity\Webform->invokeHandlers('confirmForm', Array, Object(Drupal\Core\Form\FormState), Object(Drupal\webform\Entity\WebformSubmission))
#8 [internal function]: Drupal\webform\WebformSubmissionForm->confirmForm(Array, Object(Drupal\Core\Form\FormState))
#9 /core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array(Array, Array)
#10 /core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#11 /core/lib/Drupal/Core/Form/FormBuilder.php(595): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#12 /core/lib/Drupal/Core/Form/FormBuilder.php(323): Drupal\Core\Form\FormBuilder->processForm('webform_submiss...', Array, Object(Drupal\Core\Form\FormState))
#13 /core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\webform\WebformSubmissionForm), Object(Drupal\Core\Form\FormState))
#14 /modules/contrib/webform/src/Entity/Webform.php(1249): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\webform\Entity\WebformSubmission), 'add')
#15 /modules/contrib/webform/src/Controller/WebformEntityController.php(77): Drupal\webform\Entity\Webform->getSubmissionForm()
#16 [internal function]: Drupal\webform\Controller\WebformEntityController->addForm(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\webform\Entity\Webform))

🐛 Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

🇧🇪Belgium hansrossel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024