Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is an issue where default values are not save/applied when they are selected for a value that are within a grid.
Comment | File | Size | Author |
---|---|---|---|
#12 | webform-grid_default_value-1534788-12.patch | 1.14 KB | DanChadwick |
#7 | webform-grid_default_value-1534788-6.patch | 3.6 KB | DanChadwick |
Comments
Comment #1
quicksketchGrid components don't have any ability to set default values at all, so I'm not sure exactly what you're describing. I'm moving this to a feature request if that's what you're wanting.
Comment #2
Liam MorlandWhen options_element is installed, there is a radio button which looks like it ought to set the default value for grid components, but it does nothing. This radio button should not appear for the questions in any case. For the options, it should set the default option.
This current issue is about adding the ability to set default options. This issue in the options_element queue is about removing the ineffective radio buttons: #1662892: Default value radio should not appear for Webform grid elements
Comment #3
rickiellen CreditAttribution: rickiellen commentedDon't we need to be able to set a default value for radio options in a grid?
I am seeing errors otherwise, and found this relevant issue: ...receiving the "An illegal choice has been detected. Please contact the site administrator." error every time a form is submitted that has radio buttons that are not required and have no default.
A detailed description of our issue can be found in the Webform Issue queue at http://drupal.org/node/1565696
Comment #4
Liam MorlandThis issue is a feature request for adding a default option for grid elements.
I am not seeing the "An illegal choice" messages. In any case, the issue for that is #1565696: Select Component non-mandatory with no default throws "An illegal choice has been detected." .
Comment #5
jastraat CreditAttribution: jastraat commentedI would like to second this feature request. It's nice to be able to offer a N/A default option on grid elements.
Comment #7
DanChadwick CreditAttribution: DanChadwick commentedAdded a default value to grid options list. Supports optional options_element module for advanced UI editing of key|value pairs.
Due to the awesomeness of how quicksketch only stores component options that aren't the default, no upgrade is needed. The default is simply no default.
Committed to 7.x-4.x and 8.x.
Comment #9
DanChadwick CreditAttribution: DanChadwick commentedDarn it. Commits mentioned in #8 have the completely wrong message due to a copy/paste error when I was making them. They are not for this issue. They are for:
#2207047: Unable to deselect in grid blocks form submission
The only way I can fix this would be to reverse them for this issue and re-patch for the correct one. However, since these two issues are somewhat similar, I've elected to just document it here.
Comment #11
DanChadwick CreditAttribution: DanChadwick commentedAnd double-darn-it. The above commit b6e6275 is for #2291843: next_serial needs default value.
Comment #12
DanChadwick CreditAttribution: DanChadwick commentedAlas, there was a bug in defaulting with certain keys. That it worked at all was do to PHP automatic type coercion. The default value must be expanded into an array of defaults, one for each question, in _webform_render_grid.