Show Eloqua Form Name & Connection Status in Webform Handler Summary

Created on 10 April 2024, 3 months ago
Updated 27 April 2024, 2 months ago

Problem/Motivation

The summary field on the Email/Handlers table is blank.

Steps to reproduce

View the webform Email/Handlers table.

Proposed resolution

Display the form name in the summary with connection status and link if not.

Remaining tasks


Add the connection status

User interface changes

The form name will show.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Needs review

Version

2.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States PapaGrande

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

Merge Requests

Comments & Activities

  • Issue created by @PapaGrande
  • Assigned to PapaGrande
  • πŸ‡ΊπŸ‡ΈUnited States PapaGrande
  • Merge request !7Add handler summary form β†’ (Open) created by PapaGrande
  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States PapaGrande
  • πŸ‡ΊπŸ‡ΈUnited States erindarri

    Thanks for improving this form!

    When I initially updated with this patch and my token was incorrect, the forms weren't connected correctly, so I don't see any form name listed (as expected). However, I do also get a warning:

    Warning: Undefined array key 173 in Drupal\webform_eloqua\Plugin\WebformHandler\WebformEloquaHandler->getSummary() (line 79 of modules/contrib/webform_eloqua/src/Plugin/WebformHandler/WebformEloquaHandler.php).
    
    Drupal\webform_eloqua\Plugin\WebformHandler\WebformEloquaHandler->getSummary() (Line: 100)
    Drupal\webform\WebformEntityHandlersForm->form(Array, Object) (Line: 107)
    Drupal\Core\Entity\EntityForm->buildForm(Array, Object) (Line: 69)
    Drupal\webform\WebformEntityHandlersForm->buildForm(Array, Object)
    call_user_func_array(Array, Array) (Line: 536)
    Drupal\Core\Form\FormBuilder->retrieveForm('webform_handlers_form', Object) (Line: 283)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
    Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    Is it possible to combine this with MR !6 ✨ Provide a message to the end user when the authentication token fails Needs review to show a message that says to update the token with the link to the API and secrets at this point instead of once it is in the form like in the other MR? If this could be displayed here, I don't think that MR !6 is necessary.

    Once I got my token, the form name displays as expected.

  • Status changed to Needs work 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States PapaGrande

    Based on https://www.drupal.org/project/eloqua_api_redux/issues/3358253#comment-15571333 πŸ“Œ Provide a message to the end user when the authentication token fails Needs review , let's add a refresh token check to the summary as well.

  • πŸ‡ΊπŸ‡ΈUnited States PapaGrande

    After some discussion, we figured out we can use the getForm() method on the eloquaFormsService using the form ID stored in the handler to see if the API is reachable. We can use that to display the API connection status in the handler summary along with a link to the settings page if it is not.

  • Status changed to Needs review 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States PapaGrande

    Ready for testing & review

Production build 0.69.0 2024