There is an issue where default values are not save/applied when they are selected for a value that are within a grid.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Title: grid default value » Allow default values for Grid components
Category: bug » feature

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

Liam Morland’s picture

Version: 7.x-3.7 » 7.x-4.x-dev

When 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

rickiellen’s picture

Version: 7.x-4.x-dev » 7.x-3.17
Category: feature » support

Don'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

Liam Morland’s picture

Version: 7.x-3.17 » 7.x-4.x-dev
Category: support » feature

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

jastraat’s picture

I would like to second this feature request. It's nice to be able to offer a N/A default option on grid elements.

  • Commit 3d5948f on 7.x-4.x by DanChadwick:
    Issued #1534788 by DanChadwick: Added default value to grid component.
    
  • Commit fd07468 on 8.x-4.x by DanChadwick:
    Issued #1534788 by DanChadwick: Added default value to grid component.
    
DanChadwick’s picture

Assigned: Unassigned » DanChadwick
Issue summary: View changes
Status: Active » Fixed
FileSize
3.6 KB

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

  • Commit 4ac2527 on 7.x-4.x by DanChadwick:
    Issue #1534788 by DanChadwick: Added default value to grid component.
    
  • Commit 22d48db on 8.x-4.x by DanChadwick:
    Issue #1534788 by DanChadwick: Added default value to grid component.
    
DanChadwick’s picture

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

DanChadwick’s picture

And double-darn-it. The above commit b6e6275 is for #2291843: next_serial needs default value.

DanChadwick’s picture

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

  • DanChadwick committed 54d7dde on 7.x-4.x
    Issue #1534788 by DanChadwick: Fixed grid component default value with...
  • DanChadwick committed 201f609 on 8.x-4.x
    Issue #1534788 by DanChadwick: Fixed grid component default value with...

Status: Fixed » Closed (fixed)

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