Select stores "Some readable option" not safe_key

sethcohn - July 8, 2008 - 14:47
Project:Webform
Version:5.x-2.1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Despite the report in #259400: select.inc does not return proper vaule, using multiple select (aka checkboxes), the db is storing the Readable, NOT the key value, and as a result, viewing the submission ends up with empty values for these checkboxes (since they don't match the keys it's looking for to populate the checkboxes correctly)

Removing the |Readable Value part of the select, everything functions correctly.

#1

quicksketch - July 12, 2008 - 22:01
Status:active» fixed

Thanks, you're very correct. I've fixed this with the following patches.

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

#2

Anonymous (not verified) - July 31, 2008 - 04:47
Status:fixed» closed

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

#3

vacilando - August 20, 2008 - 20:59
Priority:normal» critical
Status:closed» active

The problem seems to have reappeared in 2.1.3...
I am using the 'select' component with %get[act]|%get[act].
The form looks OK:
<input type="radio" name="submitted[aangevraagde_activiteit]" value="hoe-richt-je-een-hip-online-bedrijf-op"   class="form-radio" />
but after submit I have that 'invalid choice' message.
When I try choice|%get[act] it works -- but in the e-mail it records selection 'choice' and not the value ('hoe-richt-je-een-hip-online-bedrijf-op')!

I've also tried 5.x-2.x-dev of 18 August but situation is the same.

Any idea of a quick help? I've been labouring on a task for days and this problem is the last bit that prevents me from finishing it. Thanks so much in advance for any hints.

#4

vacilando - August 20, 2008 - 23:26

Further about this -- I have now tried the same with 'textfield' component (set as non-editable), with %get[act] as the value.
After submit the field clears (!) and there is an error message saying the field is mandatory.

I then tried using token %server[QUERY_STRING]
On view this loaded: q=uitstap&act=hoe-richt-je-een-hip-online-bedrijf-op
and the form accepted it (!), but the only thing that was then mentioned in the e-mail was: q=uitstap

Hope this helps to solve this riddle...

#5

quicksketch - August 23, 2008 - 04:18
Priority:critical» normal
Status:active» closed

@vacilando: yours is a completely different bug. See #223388: %get[], tokens do not work in disabled or hidden fields

 
 

Drupal is a registered trademark of Dries Buytaert.