Commit 8ee19171 authored by anthonylindsay's avatar anthonylindsay

Revert "Initialised products array when settings empty and removed bad bock region."

This reverts commit 7361150d.
parent 7d591d16
......@@ -136,6 +136,7 @@ function commerce_popular_products_block_info() {
// A block To display a popular product.
$blocks['popular-product-block'] = array(
'info' => t('Commerce Popular Products display block'),
'region' => array('Content'),
'weight' => '-50',
);
return $blocks;
......@@ -192,19 +193,6 @@ function commerce_popular_products_settings_form($form, &$form_state) {
$number = variable_get('commerce_popular_products_number', $default = '1');
$products = variable_get('commerce_popular_products_products');
$title = variable_get('commerce_popular_products_title', 'Popular Products This Month');
$product_types = commerce_popular_products_get_product_types();
$options = array();
foreach ($product_types as $type) {
$options[$type] = $type;
}
if (!isset($products)) {
$product_array = array();
foreach ($product_types as $type) {
$product_array[$type] = 0;
}
$products = $product_array;
}
$form['block_title'] = array(
'#type' => 'textfield',
'#title' => t('Block title.'),
......@@ -217,7 +205,11 @@ function commerce_popular_products_settings_form($form, &$form_state) {
'#description' => t('Product nodes to include in the popularity check.'),
'#default_value' => $products,
);
$product_types = commerce_popular_products_get_product_types();
$options = array();
foreach ($product_types as $type) {
$options[$type] = $type;
}
$form['product_types']['#options'] = $options;
$form['time_period'] = array(
'#type' => 'radios',
......@@ -244,7 +236,7 @@ function commerce_popular_products_settings_form($form, &$form_state) {
),
'#default_value' => $number,
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'));;
return $form;
}
......
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