Reporting mixes up fields from two webforms

mgenovese - April 28, 2008 - 05:41
Project:webform report
Version:5.x-2.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

Hi there,

First off, I'm using 5.x-1.4 of Webform report, and the latest (5.x-2.0-beta3) of webforms. My site is Drupal 5.7.

I have two nodes, each with a different webform (say webform A and webform B). I created a webform report node for webform B to report on its fields. When editing the webform, it works just fine - allows me to select the appropriate fields from B's fields.

However, when I view that webform report, it's pulling in data from webform A and webform B. The columns have fields from both webforms. All screwed up.

Ideas? Thanks!

#1

mgenovese - May 5, 2008 - 01:24

Hello?

#2

klance - May 22, 2008 - 18:49

Hey, sorry for the long delay in replying. I haven't seen this happen before, and the report pulls its data from webform's tables using the node ID of the webform, so I don't see how it would mix results from two webforms. Could be something with the latest version of webform. I'll check it out.

#3

mgenovese - May 23, 2008 - 01:51

Great - thanks very much!

#4

klance - August 8, 2008 - 18:02
Status:active» fixed

#5

presleyd - August 12, 2008 - 20:37
Version:5.x-1.4» 5.x-2.0

I am now having this happen with Webform 2.1.3 and webform report 2.0.

All of my reports seem to have the data from every webform in them.

#6

presleyd - August 13, 2008 - 16:46
Status:fixed» active

#7

klance - August 21, 2008 - 15:02

Hi presleyd, did you run update.php? There are some db changes in this version.

#8

presleyd - August 25, 2008 - 18:16

Yes, I did but this was the only version of Webform report I've ever installed.

#9

klance - September 4, 2008 - 19:23

Okay, thanks for the info. I'm not sure what's up since I can't reproduce this. What other modules are you running, presleyd, and what database backend?

#10

presleyd - September 9, 2008 - 15:27

MySQL 5.0.27 for win32 with PHP 5.2.5

CCK
Webform
Date
Calendar
TAC
Views
LDAP Authentication
Image
TinyMCE
Feedapi
Taxonomy Image
Usernode
LoginToboggan
Pathauto
XML Sitemap

#11

klance - September 26, 2008 - 15:18

I believe this is fixed by 5.x-2.1. Please give it a boot and let me know. Thanks.

#12

MariaY - September 26, 2008 - 20:27

In my case, the column titles are still wrong, but the data is correct. Very strange! Column titles are taken from a different form than chosen for the report, but the data in the column is from the report chosen. Sometimes the column titles are wrong and taken from the same form as chosen from the report. Hope it can be fixed. Good luck! :)

#13

shweta28 - September 29, 2008 - 16:55

Ditto. I get the data correct but the column titles are from different form.

#14

MariaY - October 9, 2008 - 08:46

I upgraded to webform_report 5.x-2.2 and now I have double entries in every column! HELP!!! Also, the wrong column title problem persists.

#15

klance - October 20, 2008 - 15:48

I'm going to look into it this week. I'm backporting the newly-rewritten 6.x version to 5.x and that should fix most problems like this.

#16

presleyd - October 13, 2008 - 15:22

This is fixed in 6.x-1.3 for me.

#17

presleyd - November 11, 2008 - 17:00
Status:active» fixed

No follow up original issue poster in some time, considering this closed.

#18

snarlydwarf - November 20, 2008 - 21:15
Status:fixed» needs review

This is caused because webform reuses component id's. So to be unique, the pair of node id and component id must be checked.

See the big SELECT around line 529 of webform_report.module.

Make the JOIN consider nids:

<?php
                        LEFT JOIN
{webform_component} c ON ( d.cid = c.cid AND d.nid = c.nid )
?>

That should get rid of the duplicating field content.

For grins, my SELECT right now looks like:

<?php
    $result
= db_query("SELECT w.nid, c.name, c.cid, c.type, d.nid, d.sid, d.data, s.uid, u.name as user, s.submitted, s.remote_addr, d.no, c.type
                        FROM {webform} w
                        LEFT JOIN {webform_submitted_data} d ON w.nid = d.nid
                        LEFT JOIN {webform_component} c ON ( d.cid = c.cid AND d.nid = c.nid )
                        LEFT JOIN {webform_submissions} s ON d.sid = s.sid
                        LEFT JOIN {users} u ON s.uid = u.uid
                        WHERE w.nid = '"
. $node->wnid . "'
                        AND ("
. $query . ")
                        ORDER BY d.sid, c.cid, d.no, c.name, d.data"
);
?>

I added d.no so that date fields would be useful. of course, they are still bizarre on the display, but that is some other bug somewhere or should be.

(No idea why this is closed, it is clearly unfixed on 5.x-2.x)

#19

mark.luyten - December 30, 2008 - 11:29

Applied the above patch on webforms report 5.X-2.2 and got rid of multiple values for a field (as many as different forms). However have still a warning:
warning: Invalid argument supplied for foreach() in /var/www/vhosts/oxaco-tennis.be/httpdocs/sites/all/modules/cck/fieldgroup.module on line 394.

Also, when creating a new report and choosing a form, at first i get a warning on not finding the right form but it finds the fields and one can continue creating the report!

Also when using phpadmin and inspecting the wedform-submissions and webform submissions-datafile i get warnings on misuse of indexes!

#20

bomarmonk - January 5, 2009 - 21:25
Priority:normal» critical

Any update on this? I would like to use this for my website, but it sounds like the 5.X-2.2 version is unstable until this is fixed. Changing this issue to critical (you can correct me if I'm wrong, but these issues sound truly problematic).

#21

Cayenne - February 7, 2009 - 01:03

Subscribing. Don't make me write my own!!

 
 

Drupal is a registered trademark of Dries Buytaert.