With the current views implementation, it is not possible to bring in the webform submissions if your base table is either node or users.

Patch to follow...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

travist’s picture

Status: Active » Needs review
FileSize
1.61 KB

Here is the patch.

vernond’s picture

@travist - Shouldn't this be in the views issue queue? Your patch doesn't appear to changing any webform code.

travist’s picture

This code is in the webform module, within the views folder.

Thanks,

Travis.

vernond’s picture

:-) Clearly I was at the end of a caffeine cycle!

dawehner’s picture

Status: Needs review » Needs work
+++ b/views/webform.views.incundefined
@@ -15,6 +15,20 @@ function webform_views_data() {
+  $data['webform_submissions']['table']['join'] = array(
+    'node' => array(
+      'table' => 'webform_submissions',
+      'field' => 'nid',      ¶
+      'left_field' => 'nid',
+      'left_table' => 'node',
+    ),
+    'users' => array(
+      'table' => 'webform_submissions',
+      'field' => 'uid',      ¶
+      'left_field' => 'uid',
+      'left_table' => 'users',
+    ),

I don't think a implicit relationship is required here. A relationship is actually always what you want.

derhasi’s picture

Assigned: Unassigned » derhasi
Category: bug » feature
Status: Needs work » Needs review
Issue tags: +dvcs11
FileSize
2.44 KB

With dereine's comment I generated a new patch, removing the implicit reference, but adding a reverse relationship, so we have the control over what relationships are built.

quicksketch’s picture

This new patch in #6 looks great to me, though I'd prefer another reviewer to check it out also.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

In general this looks fine, but didn't tested it.

xlyz’s picture

using it now.

please commit :)

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Tested it out and it works as advertised. I can add a relationship from a "Webform submissions" view to both the parent Webform node and to the user who made the submission. I can do it the other way around and add a relationship to a "Webform submission" from either a node or user view. Looks good to me. Committed to both 3.x branches.

xlyz’s picture

can you please add the -dev version to downloads?

derhasi’s picture

xlyz, you can use the "View all releases" link at the bottom of the project page, or when using drush,
simply enter drush dl webform --select.

quicksketch’s picture

can you please add the -dev version to downloads?

I don't like -dev releases because then I start getting bug reports against -dev versions that some silly person downloaded "about 3 months ago" as bug reports. End-users should use stable releases. If they want to use a dev release, they should know how to download the dev release (per derhasi's instructions).

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