Hello, I created several web forms using the "pre-built option list" to generate a dynamic select field. The values are generated based on certain date range (i.e. list all events from now going back 3 months). Once the date has passed, the options will change accordingly and the new events within the new range should be displayed.
Any previous submissions, from the time those past dates were active, were saved accordingly.
When I try to display the webform-results/table, all I get is a blank page or the page never finished to load. I guess the display is looking at the current values of the select and it is not finding those past keys anymore thus creating the display freezing problem.
Does it makes sense to display all the submissions, independently of the current values of the select, instead of failing because the key is not there anymore? I would like to believe the dynamic select is flexible enough to allow this type of functionality. Instead of having static arrays of key/values to allow having time-changing key/values pairs without loosing historical data.
Comments
Comment #1
quicksketchWebform *should* work even in this situation. Of course if the key => value pair is no longer provided, Webform can no longer show what the "value" part is since it only stores the "key" part in the database. The theme_webform_display_select() function contains this code which should have the functionality of at least showing the "key" part:
It's assuming that the user has entered a value through the Select or Other module here, but it should work for any value that's no longer in the select list.
If you're getting a blank page, my guess is you're probably getting a memory or page timeout error. You should turn on PHP's display_errors option in your php.ini file so you can tell what this error actually is instead of a white page. The most likely cause of this is Webform calling your module's for a list of options on every single result. Webform does NOT do any caching of these select list options, meaning that if you're doing a custom list with a query, that query is being done on every single submission (perhaps even more than once). You may have the the same query being executed hundreds of times, causing the page to crash.
Comment #2
luthien commentedI think the latest is what is happening, the query is executed for each single submission more than once. thanks.
Comment #3
quicksketch