Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
It is possible to add multiple webforms to a node a multiple value field and/or two webform field. Currently, when two webforms are associated with one node, the first webform is considered the primary (and only) webform.
Solution
Add Webform dropdown menu to a webform node's 'Test' and 'Results' (Submissions, Download, Clear) tabs.
Tasks
- Add WebformEntityReferenceItem::getEntityWebformId
- Add WebformEntityReferenceItem::getEntityWebformFieldNames
- Add WebformEntityReferenceItem::hasEntityWebformMultiple
- Check for WebformEntityReferenceItem::hasEntityWebformMultiple and disable Webform Node tabs.
- Add $_SESSION checking to ::getEntityWebformFieldName
- Place Webform dropdown menu using hook_preprocess_page_title().
Comment | File | Size | Author |
---|
Comments
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThis issue is going to require some major refactoring, so I am going to have to post a few patches that need to be tested via the test bot.
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #9
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #12
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #14
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #17
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 commentedI committed the patch. Please download the latest dev release to review.
Below is a screenshot of the toggle webform reference.
Comment #23
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #25
frau.wolf CreditAttribution: frau.wolf commented@jrockowitz Thank you so much for implementing this feature, it still needs a bit of work though.
I just tried to attach two webforms to a node, and fill them out as authenticated user and anonymous user. In the results of the node itself it only shows the submissions for the primary (first) webform. All 4 submissions are stored and can be accessed in the general Webforms: Submissions tab.
Screenshots can be found here: https://imgur.com/a/v8tmsct