Don't require source entity type to be specified in querystring if it is configured

Created on 2 August 2023, over 1 year ago

Problem/Motivation

There is a webform setting "Type of source entity to be populated using query string parameters" giving the setting 'form_prepopulate_source_entity_type'.

But even if you use that to specify the type of source entity, you still have to specify the entity type in the query string using the 'source_entity_type' parameter. This is unnecessary.

Proposed resolution

Change QueryStringWebformSourceEntity to make use of $webform->getSetting('form_prepopulate_source_entity_type') if the source entity type is not explicitly specified in the querystring.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ“Œ Task
Status

Active

Version

6.2

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

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

Merge Requests

Comments & Activities

  • Issue created by @jonathanshaw
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    Not currently mergeable.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    492 pass, 72 fail
  • Status changed to Needs review over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK
  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    534 pass
  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

    The test fails were a bit weird, seems like the querystring source plugin is running when webform submissions are being viewed, but in those cases there is no upcast webform route parameter to get the setting from.

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    We need to document the steps required to reproduce this issue.

  • Status changed to Needs work 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • Status changed to Needs review 9 months ago
  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

    Added steps to reproduce

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 9 months ago
    495 pass, 68 fail
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    I tweaked the MR to be very simple enhancement.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 9 months ago
    495 pass, 68 fail
  • Pipeline finished with Canceled
    9 months ago
    Total: 58s
    #141125
  • Pipeline finished with Failed
    9 months ago
    Total: 1938s
    #141128
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 9 months ago
    536 pass
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    I reverted my two commits. I am baffled why all those tests broken.

    Below is the code snippet I was trying to use

        // Get and check source entity type.
        $source_entity_type = $this->request->query->get('source_entity_type');
        // If the source entity type is not defined, attempt to get the
        // source entity type from the webform's settings.
        if (!$source_entity_type && $webform->getSetting('form_prepopulate_source_entity')) {
          $source_entity_type = $webform->getSetting('form_prepopulate_source_entity_type');
        }
        if (!$source_entity_type || !$this->entityTypeManager->hasDefinition($source_entity_type)) {
          return NULL;
        }
    
    
  • Pipeline finished with Success
    9 months ago
    Total: 2057s
    #141289
  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

    See #5. In some circumstances the webform parameter is not upcast by the route.

  • Pipeline finished with Failed
    3 months ago
    Total: 524s
    #300668
  • Pipeline finished with Failed
    2 months ago
    Total: 890s
    #307025
  • Pipeline finished with Failed
    2 months ago
    Total: 564s
    #309500
  • Pipeline finished with Failed
    2 months ago
    Total: 423s
    #309589
  • Pipeline finished with Failed
    2 months ago
    Total: 443s
    #311640
  • Pipeline finished with Failed
    2 months ago
    Total: 409s
    #312673
  • Pipeline finished with Failed
    2 months ago
    Total: 492s
    #312733
  • Pipeline finished with Failed
    2 months ago
    Total: 57200s
    #312926
  • Pipeline finished with Failed
    2 months ago
    Total: 663s
    #313742
  • Pipeline finished with Success
    2 months ago
    Total: 407s
    #313792
  • Pipeline finished with Success
    2 months ago
    Total: 980s
    #313818
  • Pipeline finished with Failed
    2 months ago
    Total: 9800s
    #317089
  • Pipeline finished with Success
    about 2 months ago
    Total: 519s
    #319154
  • Pipeline finished with Failed
    about 2 months ago
    Total: 612s
    #319306
  • Pipeline finished with Failed
    about 2 months ago
    Total: 460s
    #319348
  • Pipeline finished with Failed
    about 2 months ago
    Total: 1070s
    #319390
  • Pipeline finished with Success
    about 2 months ago
    Total: 461s
    #319416
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 110s
    #319508
  • Pipeline finished with Failed
    about 2 months ago
    Total: 498s
    #319509
  • Pipeline finished with Success
    about 2 months ago
    Total: 461s
    #319515
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    I am open to merging this AS-IS

  • Pipeline finished with Canceled
    28 days ago
    Total: 71s
    #348448
  • Pipeline finished with Failed
    28 days ago
    Total: 769s
    #348449
  • Pipeline finished with Failed
    4 days ago
    Total: 159s
    #372644
  • Pipeline finished with Success
    4 days ago
    Total: 161s
    #372646
  • Pipeline finished with Success
    4 days ago
    Total: 163s
    #372649
Production build 0.71.5 2024