diff --git a/weather.forms.inc b/weather.forms.inc index 33ee95a..5284d74 100644 --- a/weather.forms.inc +++ b/weather.forms.inc @@ -58,7 +58,8 @@ function weather_admin_main_page() { } } } - $output .= drupal_render(drupal_get_form('weather_admin_main_page_form')); + $form = drupal_get_form('weather_admin_main_page_form'); + $output .= drupal_render($form); return $output; } @@ -643,7 +644,8 @@ function weather_search_location($search = NULL) { $metar = weather_get_metar($location->icao); $location->real_name = $location->name; $output = theme('weather_theming', array('display' => $display, 'location' => $location, 'metar' => $metar)); - $output .= drupal_render(drupal_get_form('weather_search_form')); + $form = drupal_get_form('weather_search_form'); + $output .= drupal_render($form); return $output; } } @@ -674,7 +676,8 @@ function weather_search_location($search = NULL) { $metar = weather_get_metar($location->icao); $location->real_name = $location->name; $output = theme('weather_theming', array('display' => $display, 'location' => $location, 'metar' => $metar)); - $output .= drupal_render(drupal_get_form('weather_search_form')); + $form = drupal_get_form('weather_search_form'); + $output .= drupal_render($form); return $output; } else { @@ -686,7 +689,8 @@ function weather_search_location($search = NULL) { } $title = t('Search results for @search', array('@search' => $search)); $output = theme('item_list', array('items' => $links, 'title' => $title)); - $output .= drupal_render(drupal_get_form('weather_search_form')); + $form = drupal_get_form('weather_search_form'); + $output .= drupal_render($form); return $output; } } diff --git a/weather.module b/weather.module index 8b3ad5f..deb9159 100644 --- a/weather.module +++ b/weather.module @@ -398,6 +398,7 @@ function weather_get_display_settings($display_type, $display_number=NULL) { array(':type' => 'default'))->fetchObject(); if (empty($settings)) { // There are no custom default settings. Get module's default settings. + $settings = new stdClass(); $settings->units = array( 'temperature' => 'celsius', 'windspeed' => 'kmh',