Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Category: Feature request » Task
Status: Fixed » Active

  • jrockowitz committed aeb62cc on 2865353-improve-submission-log
    Issue #2865353: Improve submission log integration
    
jrockowitz’s picture

Status: Active » Needs review
FileSize
132.84 KB
jrockowitz’s picture

Instead of using a handler, submission logging is now just a webform setting and global setting.

  • jrockowitz committed fd0b8c3 on 2865353-improve-submission-log
    Issue #2865353: Improve submission log integration
    

  • jrockowitz committed c880c78 on 2865353-improve-submission-log
    Issue #2865353: Improve submission log integration
    

  • jrockowitz committed e2de680 on 2865353-improve-submission-log
    Issue #2865353: Improve submission log integration.
    
jrockowitz’s picture

  • jrockowitz committed 614c87c on 8.x-5.x
    Issue #2865353 by jrockowitz: Improve submission log integration
    
jrockowitz’s picture

Status: Needs review » Fixed
kclarkson’s picture

Jake,

so I ran a drush dl 8.x-5.x then did a drush updb to implement your changes in the database.

When I went the webform settings I only had the one option to log all submissions under submission behaviors.

After submitting a test form Here is the error I received:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'webform_id' in 'field list': INSERT INTO {webform_submission_log} (handler_id, operation, message, data, uid, webform_id, sid, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => faculty_funding_submission_confirmation [:db_insert_placeholder_1] => sent email [:db_insert_placeholder_2] => Drupal\Core\StringTranslation\TranslatableMarkup Object ( [string:protected] => '@subject' sent to '@to_mail' from '@from_name' [@from_mail]'. [translatedMarkup:protected] => '@subject' sent to '@to_mail' from '@from_name' [@from_mail]'. [options:protected] => Array ( ) [stringTranslation:protected] => Drupal\Core\StringTranslation\TranslationManager Object ( [translators:protected] => Array ( [30] => Array ( [0] => Drupal\Core\StringTranslation\Translator\CustomStrings Object ( [settings:protected] => Drupal\Core\Site\Settings Object ( [storage:Drupal\Core\Site\Settings:private] => Array ( [container_yamls] => Array ( [0] => /Users/kclarks2/Sites/dev/cetl8/sites/default/services.yml [1] => /Users/kclarks2/Sites/dev/cetl8/sites/development.services.yml ) [file_private_path] => sites/default/files/private [file_scan_ignore_directories] => Array ( [0] => node_modules [1] => bower_components ) [extension_discovery_scan_tests] => 1 [rebuild_access] => 1 [install_profile] => standard [hash_salt] => NSk8ld5U8dG6uHVGIy7eTXY8S3MHqKSZPANkRhg31pA_vOi9qZBYaGN1HcpwrxrJGWepAz8RVg ) [_serviceId] => settings ) [translations:protected] => Array ( [en] => Array ( ) ) [_serviceIds:protected] => Array ( ) [_serviceId] => string_translator.custom_strings ) ) ) [sortedTranslators:protected] => Array ( [0] => Drupal\Core\StringTranslation\Translator\CustomStrings Object ( [settings:protected] => Drupal\Core\Site\Settings Object ( [storage:Drupal\Core\Site\Settings:private] => Array ( [container_yamls] => Array ( [0] => /Users/kclarks2/Sites/dev/cetl8/sites/default/services.yml [1] => /Users/kclarks2/Sites/dev/cetl8/sites/development.services.yml ) [file_private_path] => sites/default/files/private [file_scan_ignore_directories] => Array ( [0] => node_modules [1] => bower_components ) [extension_discovery_scan_tests] => 1 [rebuild_access] => 1 [install_profile] => standard [hash_salt] => NSk8ld5U8dG6uHVGIy7eTXY8S3MHqKSZPANkRhg31pA_vOi9qZBYaGN1HcpwrxrJGWepAz8RVg ) [_serviceId] => settings ) [translations:protected] => Array ( [en] => Array ( ) ) [_serviceIds:protected] => Array ( ) [_serviceId] => string_translator.custom_strings ) ) [defaultLangcode:protected] => en [_serviceId] => string_translation ) [arguments:protected] => Array ( [@from_name] => Center for Excellence in Teaching and Learning [@from_mail] => cetl@kennesaw.edu [@to_mail] => kaleemclarkson+stephen@gmail.com [@subject] => The Faculty Funding Application Confirmation ) ) [:db_insert_placeholder_3] => a:0:{} [:db_insert_placeholder_4] => 2 [:db_insert_placeholder_5] => faculty_funding_application [:db_insert_placeholder_6] => 13 [:db_insert_placeholder_7] => 1490900443 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 770 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Database\Statement->execute(Array, Array) (Line: 610)
Drupal\Core\Database\Connection->query('INSERT INTO {webform_submission_log} (handler_id, operation, message, data, uid, webform_id, sid, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7)', Array, Array) (Line: 81)
Drupal\Core\Database\Driver\mysql\Connection->query('INSERT INTO {webform_submission_log} (handler_id, operation, message, data, uid, webform_id, sid, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7)', Array, Array) (Line: 32)
Drupal\Core\Database\Driver\mysql\Insert->execute() (Line: 985)
Drupal\webform\WebformSubmissionStorage->log(Object, Array) (Line: 380)
Drupal\webform\WebformHandlerBase->log(Object, 'sent email', Object) (Line: 801)
Drupal\webform\Plugin\WebformHandler\EmailWebformHandler->sendMessage(Object, Array) (Line: 541)
Drupal\webform\Plugin\WebformHandler\EmailWebformHandler->postSave(Object, , NULL) (Line: 1552)
Drupal\webform\Entity\Webform->invokeHandlers('postSave', Object, , NULL) (Line: 749)
Drupal\webform\WebformSubmissionStorage->invokeWebformHandlers('postSave', Object, ) (Line: 648)
Drupal\webform\WebformSubmissionStorage->doPostSave(Object, ) (Line: 395)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 761)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 364)
Drupal\Core\Entity\Entity->save() (Line: 681)
Drupal\webform\Entity\WebformSubmission->save() (Line: 905)
Drupal\webform\WebformSubmissionForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder->processForm('webform_submission_faculty_funding_application_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('webform_submission_faculty_funding_application_form', Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'default') (Line: 798)
Drupal\webform\Entity\Webform->getSubmissionForm(Array) (Line: 83)
Drupal\webform\Plugin\Field\FieldFormatter\WebformEntityReferenceEntityFormatter->viewElements(Object, 'en') (Line: 80)
Drupal\Core\Field\FormatterBase->view(Object, 'en') (Line: 76)
Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase->view(Object, NULL) (Line: 259)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 319)
Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 24)
Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 262)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 219)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • jrockowitz committed 2347e60 on 8.x-5.x
    Issue #2865353: Improve submission log integration.
    
kclarkson’s picture

thanks error is gone and log shows when submissions are updated.

  • jrockowitz committed 5ed950e on 8.x-5.x
    Issue #2865353: Improve submission log integration
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.