On the general download page
/admin/structure/webform/manage//results/download
In the 'Download' section you can select the node on which the form is used to download only the submission from that node.
In the field however you must enter the numerical id of the node, which is not user-friendly.
I've created a small patch that replaces this field with a select in which the mode can be selected by title.
User Acceptance Test
✅ Confirm export 'Submitted to' works as expected
- /admin/structure/webform/manage/{webform}/results/download
✅ Confirm 'Options limit' handler works as expected
✅ Confirm 'Resend' email form works as expected
- /admin/structure/webform/manage/{webform}/submission/{webform_submission}/resend
✅ Confirm 'Email' handler options mapping works as expected
- /admin/structure/webform/manage/test_handler_email_mapping/handlers
✅ Confirm 'Test (Ajax) Element' is working as expected
- /admin/structure/webform/manage/test_handler_email_mapping/element/add/webform_test_element_properties
Comment | File | Size | Author |
---|---|---|---|
#30 | 3095978-29.patch | 631 bytes | protractor |
#28 | 3095978-26.patch | 630 bytes | protractor |
#22 | 3095978-22.patch | 40.03 KB | jrockowitz |
| |||
#20 | 3095978-20.patch | 43.02 KB | jrockowitz |
| |||
#18 | 3095978-18.patch | 38.43 KB | jrockowitz |
|
Comments
Comment #2
louisnagtegaal CreditAttribution: louisnagtegaal at LimoenGroen commentedAdded patch.
Comment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #4
Liam MorlandReading the code, it looks good to me.
Perhaps
$webform_id
is not needed here; instead, inline$webform->id()
.Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe problem is that the 'Submitted to' field can be any entity and the select menu is being limited to only nodes.
The only solution to improve the UX would be to use Ajax to update the entity id input based on the selected entity type.
Please review the attached patch.
Comment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe failing JavaScript test is unrelated. The patch can still be reviewed AS-IS.
Comment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedSame solution with a reusable \Drupal\webform\Element\WebformAjaxElementTrait because it is time to make it easier to create a two-step cascading Ajax element.
Comment #17
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #18
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #20
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #22
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #24
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI committed the patch. Please download the latest dev release to review.
Comment #26
protractor CreditAttribution: protractor as a volunteer commentedHi folks,
In patch 22 the database query
$entity_ids = Database::getConnection()->select('webform_submission', 's') + ->fields('s', ['entity_id']) + ->condition('s.webform_id', $webform->id()) + ->condition('s.entity_type', $entity_type) + ->execute() + ->fetchCol();
Is not really correct. I have around 180 webform submissions so I get 180 IDs here, but only 6 unique IDs. Some lines later it is checked for no more than 100 IDs to get not to many select items. I think this query should be grouped by entity_id.
Should I make a patch for this here?
Comment #27
Liam MorlandYour probably just need to add SelectInterface::distinct() to the query.
Comment #28
protractor CreditAttribution: protractor as a volunteer commentedComment #29
Liam MorlandThere is no point using
GROUP BY
unless you also using an aggregate function. UseDISTINCT
.Comment #30
protractor CreditAttribution: protractor as a volunteer commentedNo problem, I just done it because of the sortorder at the end. Some times even group by is faster than distinct.