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

Comments

Status:Active» Needs review
StatusFileSize
new1.61 KB

Here is the patch.

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

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

Thanks,

Travis.

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

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.

Assigned:Unassigned» derhasi
Category:bug» feature
Status:Needs work» Needs review
Issue tags:+dvcs11
StatusFileSize
new2.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.

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

Status:Needs review» Reviewed & tested by the community

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

using it now.

please commit :)

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.

can you please add the -dev version to downloads?

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.

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.