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?

Comments

clancy’s picture

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

quicksketch’s picture

Crap. I'll try to take a look.

quicksketch’s picture

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

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

clancy’s picture

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?

otsaw’s picture

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

Jorrit’s picture

Assigned: Unassigned » Jorrit
Status: Closed (fixed) » Needs review
StatusFileSize
new768 bytes

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

quicksketch’s picture

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.

dilvish’s picture

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

vesapalmu’s picture

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

Agilealan’s picture

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

errement’s picture

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!

greggles’s picture

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.

errement’s picture

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

errement’s picture

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.

Allthegearnoidea’s picture

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

errement’s picture

@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?

Allthegearnoidea’s picture

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?

Allthegearnoidea’s picture

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.

errement’s picture

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

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new1.79 KB

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.

errement’s picture

@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!!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

quicksketch’s picture

Status: Closed (fixed) » Fixed

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

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

thetahat’s picture

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