diff --git a/uc_attribute/uc_attribute.module b/uc_attribute/uc_attribute.module index 94e8311..4f6b92a 100644 --- a/uc_attribute/uc_attribute.module +++ b/uc_attribute/uc_attribute.module @@ -1413,6 +1413,16 @@ function _uc_attribute_alter_form($id, &$product, $use_ajax) { $form_attributes[$attribute->aid]['#default_value'] = $attribute->options[$attribute->default_option]->name; } } + elseif (count($attribute->options) > 0) { + $default = array_values($attribute->options); + $default = array_shift($default); + if ( isset($default->name) ) $default = $default->name; + else $default = ''; + $form_attributes[$attribute->aid] = array( + '#type' => 'textfield', + '#default_value' => $default, + ); + } else { $form_attributes[$attribute->aid] = array( '#type' => 'textfield',