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!

Comments

mgenovese’s picture

Hello?

klance’s picture

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.

mgenovese’s picture

Great - thanks very much!

klance’s picture

Status: Active » Fixed
presleyd’s picture

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.

presleyd’s picture

Status: Fixed » Active
klance’s picture

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

presleyd’s picture

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

klance’s picture

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?

presleyd’s picture

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

klance’s picture

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

MariaY’s picture

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! :)

perlgal’s picture

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

MariaY’s picture

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.

klance’s picture

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.

presleyd’s picture

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

presleyd’s picture

Status: Active » Fixed

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

snarlydwarf’s picture

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:

                        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:


    $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)

mark.luyten’s picture

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!

bomarmonk’s picture

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

cayenne’s picture

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

jimbullington’s picture

Status: Needs review » Reviewed & tested by the community

Will incorporate in the next 5.x release

jimbullington’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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