Cannot submit settings form, because $values['dlayout_max_width']['#default_value'] doesn't exist, only $values['dlayout_max_width']

/**
 * Validate the form.
 */
function storefront_theme_settings_validate($form, &$form_state) {

  $values = $form_state['values'];

  // Validate max_width values seperatly.
  if ($values['dlayout_set_max_width'] == 1) {
    if (empty($values['dlayout_max_width']['#default_value'])) {
      form_set_error('dlayout_max_width', t('Standard layout max-width is empty - you forgot to enter a value for the max width!'));
    }
  }
}
CommentFileSizeAuthor
#1 validation-2209311-#1-7-x.patch768 bytesbenelori
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

benelori’s picture

Uploaded patch

benelori’s picture

Status: Active » Needs review
bunnicula’s picture

The #1 patch directory tree seems to be broken, but I manually edited theme-settings.php with the changes and I can confirm this worked for me.

dudenhofer’s picture

Status: Needs review » Closed (fixed)

Thanks for the patch, but this was already fixed in this commit of the latest dev version. I didn't realize it wasn't tagged as a stable release yet, so I'll do that today.
http://cgit.drupalcode.org/storefront/commit/?id=da51834