Commit 66fa85d5 authored by anthonylindsay's avatar anthonylindsay

Removed broken default values setting for checkboxes and created new array for default values.

parent 3a97920a
......@@ -198,7 +198,6 @@ function commerce_popular_products_settings_form($form, &$form_state) {
'#type' => 'checkboxes',
'#title' => t('Product Types.'),
'#description' => t('Product nodes to include in the popularity check.'),
'#default_value' => $products,
);
}
else {
......@@ -213,6 +212,13 @@ function commerce_popular_products_settings_form($form, &$form_state) {
$options[$type] = $type;
}
$form['product_types']['#options'] = $options;
if (empty($products)) {
$products = array();
foreach ($product_types as $type) {
$products[$type] = 0;
}
}
$form['product_types']['#default_value'] = $products;
$form['time_period'] = array(
'#type' => 'radios',
'#title' => t('Timeframe.'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment