Grid component adds non-safe data to database

clancy - July 21, 2008 - 23:36
Project:Webform
Version:6.x-2.1.3
Component:Code
Category:bug report
Priority:critical
Assigned:Jorrit
Status:closed
Description

If a grid is set up with options that have safe labels (i.e. "no|No thank you!") the non-safe portion is inserted into the database (the "No thank you!") This means that the analysis and view submissions do not work for grids. I was able to fix this by commenting out the entire _webform_submit_grid function in grid.inc. Why does this function do that? it seems to break the functionality. Shouldn't the safe values always be stored in the DB?

#1

clancy - July 21, 2008 - 23:37

BTW, this is similar to the problem with the select values being stored wrong that was fixed in 2.1.2.

#2

quicksketch - July 22, 2008 - 04:31

Crap. I'll try to take a look.

#3

quicksketch - July 23, 2008 - 03:48
Status:active» fixed

The same fix applied to the select component cleared up the Grid component also. I've committed the fix to CVS.

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/webform/compo...

#4

Anonymous (not verified) - August 6, 2008 - 03:55
Status:fixed» closed

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

#5

clancy - August 10, 2008 - 17:39
Version:6.x-2.1.2» 6.x-2.1.3

Um, this is now worse (at least on mine) after upgrading to 2.1.3 it doesn't store ANY of the grid data. Just empty. What happened?

#6

otsaw - August 11, 2008 - 08:40

I confirm, on my install, 6.x-2.1.3 broke the grid. Can't see data anywhere.

#7

Jorrit - August 13, 2008 - 16:15
Assigned to:Anonymous» Jorrit
Status:closed» needs review

The patch by quicksketch changed the array key from options to items, which is wrong. The attached patch fixes this.

AttachmentSize
webform-grid.patch 768 bytes

#8

quicksketch - August 17, 2008 - 19:16

Thanks again Jorrit. I don't know how I missed this in testing. :/

I committed the fix and I'll get out (yet another) release to fix this problem.

#9

mtapman - August 18, 2008 - 18:28

The patched worked well on a 6.4 site with webform 6.x-2.1.3.

#10

wesku - August 21, 2008 - 15:45

I can also confirm that this patch fixed the problem. Thanks for a great module!

#11

Agilealan - August 23, 2008 - 21:25

And to confirm that the webform 6.x-2.x-dev update 8/23/08 fix works beautifully(scroll down 60%) as well; Thanks Quicksketch and everyone who addressed the GRID issue!!

#12

errement - August 25, 2008 - 00:25
Priority:normal» critical
Status:needs review» active

Hi quicksketch, Jorrit & all,

Sorry to announce you that AGAIN we have the same bug but this time in a different way!!!

Indeed the "patch" worked great & the 6.x.2.x-dev fixed it but, all this time you were all (or this is what i think) trying the Grid without selecting both checkboxes for:
-Randomize Options
-Randomize Questions

Am i right or am missing something here?

I have tried under drupal 6.4 project and it works fine without selecting those checkboxes but sending EMPTY again (w/o storing any data) when selected!!!

What is going on with this BIG BUG?

Hope you find a solution soon, please.

Good luck & waiting for a new posts soon commenting what happens to all of you with this new bug!

#13

greggles - August 27, 2008 - 19:48

I can confirm the behavior that errement sees in #12 - if I create a grid and randomize both questions and options then the data seems to get lost.

However, with this patch applied if I just randomize the questions and not the options then the data is saved fine.

#14

errement - August 27, 2008 - 20:40

Thank you greggles for responding!!

I tried what you said:
-Randomize Questions: work fine, as you said :-))
-Randomize Options: I get "0" (zeros) ONLY if selecting first options (if you select the first option for each question), but blank if you select other options than the first!!! :-O
-Randomize both Options & Questions = BLANK :-(

Hope we find a solution soon ;-)

#15

errement - September 1, 2008 - 22:56

Again & after TODAY's announcement of a new webform 6.x-2.x-dev version, i installed it and confirm that we are still having the same problem!!

Anybody tried it?

As quicksketch says under the release notes:

Drupal 6 development version of Webform, contains the latest features and bug fixes. Please use this release before requesting new features or reporting bugs for Drupal 6 Webform.

#16

Allthegearnoidea - September 3, 2008 - 20:09

Thank you, thank you, thank you. I was suffering from grid results not being stored.

This patch fixed it for me on version 5.x-2.1.3 of Webform.

I'm happy. :-)

#17

errement - September 3, 2008 - 23:29

@rattryde, which patch are you talking about?
The one on #7 or the link i gave on #15? cos i don't see how something made for D6 could fix a problem under D5?!

I use the latest release under D6.4 and grid results are not stored "only" if you use:

-Randomize Options

Other ways, are stored nicely.

Explain please, maybe you wanted to say:

This patch fixed it for me on version 6.x-2.1.3 of Webform.

Even so i don't know why doesn't it work for me? Anybody tried latest release?

#18

Allthegearnoidea - September 4, 2008 - 20:43

The patch in #7

Unless I'm mistaken this patch was created for D6 and my instance is definitely D5 but I thought I'd give it a go anyway.

So for sure I didn't mean to say version 6.x-2.1.3 of Webform, I definitely meant version 5.x-2.1.3

I can confirm it 100% works for me. However I should make it clear that I am not using the randomize functions at all (I have no need to, my problem was that v 5.x-2.1.3 of Webform was not populating the results of the grids at all regardless of whether or not the randomize options were selected, hence why I tried the above patch despite it not being made for D5). I could test to see if using randomize prevents the grids from working properly again if you like?

#19

Allthegearnoidea - September 4, 2008 - 20:59

Just tested it and using the randomize buttons does prevent the grid recording results properly. Luckily for me I don't need to use this function.

#20

errement - September 4, 2008 - 22:04

@rattryde,

Thanq for responding, explanation, and very happy for you that it works like you need it to ;-)
Also appreciate your intention testing it for me.

I'd like to use the "Randomize Options" but for now is not possible until hopefully quicksketch find a solution for it. Other functions works perfectly —or as i know— for me.

I like very much the module and am using it specially for my Educational exams & tests —for my students—.

#21

quicksketch - September 6, 2008 - 02:45
Status:active» fixed

Thanks everyone for the continued reports. I've looked into this further and it seems that the logic had mistakenly believed that the PHP function shuffle maintained the array keys (it does not). I'm a little surprised this worked before, as I'm not sure how we were maintaining integrity when the keys were being lost.

Regardless, this patch fixes the problem and I've committed it. I've written up a test suite to ensure this data corruption comes to an end. I'll release a 2.2 version with the fixes shortly.

AttachmentSize
grid_random_corruption.patch 1.79 KB

#22

errement - September 6, 2008 - 03:56

@quicksketch,

Thanq so so much for your patch.

I confirm that problems i mentioned here before are ALL SOLVED, it works great again!! FIXED, thx to you!!

Thanq.
;-))

Great module!!

temp

Anonymous (not verified) - September 20, 2008 - 04:06

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

#23

Anonymous (not verified) - September 20, 2008 - 04:12
Status:fixed» closed

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

#24

quicksketch - September 20, 2008 - 16:29
Status:closed» fixed

I'm moving this back into "fixed" until I get out a new release.

#25

Anonymous (not verified) - October 4, 2008 - 16:32
Status:fixed» closed

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

#26

thetahat - June 10, 2009 - 11:26

I just downloaded some data from a webform made in 8/2008 and the grid items aren't in the csv output. Does this mean that for sure the data simply doesn't exist (i.e., wasn't recorded or was destroyed in transit), or is there a chance that it's still stored in some form in the database but it will have to be extracted in some other way? If the latter is possible, can anyone provide suggestions for ways to tell if it's there, or how to extract it if it is?

Thanks for your help. The data is quite important, so any assistance would be greatly appreciated (and of course we're all kicking ourselves for not having kept a closer eye on it).

 
 

Drupal is a registered trademark of Dries Buytaert.