summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Lindsay2012-09-14 10:14:07 (GMT)
committerAnthony Lindsay2012-09-14 10:14:07 (GMT)
commit66fa85d59eab0ba9062ae2900547ca30da3d409a (patch)
tree366fe3ee167941c39a8f9521e1d9390b61ac08d3
parent3a97920af3670cbce2f07ec1af855f9ff1809e03 (diff)
Removed broken default values setting for checkboxes and created new array for default values.
-rw-r--r--commerce_popular_products.module8
1 files changed, 7 insertions, 1 deletions
diff --git a/commerce_popular_products.module b/commerce_popular_products.module
index 3db59e5..84806e2 100644
--- a/commerce_popular_products.module
+++ b/commerce_popular_products.module
@@ -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.'),