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().
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrockowitz created an issue. See original summary.

  • 65f063b committed on 2908300-multiple-webform-node
    Issue #2908300: Add support for managing multiple webforms attached to a...

  • jrockowitz committed 348a1c0 on 2908300-multiple-webform-node
    Issue #2908300: Add support for managing multiple webforms attached to a...
jrockowitz’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
25.12 KB

This 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.

Status: Needs review » Needs work

The last submitted patch, 4: add_support_for-2908300-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • jrockowitz committed e8d0e6b on 2908300-multiple-webform-node
    Issue #2908300: Add support for managing multiple webforms attached to a...
jrockowitz’s picture

Status: Needs work » Needs review
FileSize
64.72 KB

  • jrockowitz committed d44a820 on 2908300-multiple-webform-node
    Issue #2908300: Add support for managing multiple webforms attached to a...
jrockowitz’s picture

Status: Needs review » Needs work

The last submitted patch, 9: add_support_for-2908300-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • jrockowitz committed 60a7542 on 2908300-multiple-webform-node
    Issue #2908300: Add support for managing multiple webforms attached to a...
jrockowitz’s picture

Status: Needs work » Needs review
FileSize
74.07 KB

  • jrockowitz committed 59bc960 on 2908300-multiple-webform-node
    Issue #2908300: Add support for managing multiple webforms attached to a...
jrockowitz’s picture

  • jrockowitz committed 940dd18 on 2908300-multiple-webform-node
    Issue #2908300 by jrockowitz: Add support for managing multiple webforms...

  • jrockowitz committed 3373ec1 on 2908300-multiple-webform-node
    Issue #2908300 by jrockowitz: Add support for managing multiple webforms...
jrockowitz’s picture

  • jrockowitz committed 3754469 on 2908300-multiple-webform-node
    Issue #2908300 by jrockowitz: Add support for managing multiple webforms...

  • jrockowitz committed 55dc1ba on 2908300-multiple-webform-node
    Issue #2908300 by jrockowitz: Add support for managing multiple webforms...
jrockowitz’s picture

  • jrockowitz committed 1b74f15 on 8.x-5.x
    Issue #2908300 by jrockowitz: Add support for managing multiple webforms...
jrockowitz’s picture

I committed the patch. Please download the latest dev release to review.

Below is a screenshot of the toggle webform reference.

jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

frau.wolf’s picture

@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