Alter weather block behaviour? In the weather module, if a user has not configured a custom weather block, the block does not display:

/**
 * Implement hook_block_view().
 */
function weather_block_view($delta = '') {
  global $user;
  module_load_include('inc', 'weather', 'weather.common');
  $block = array();
  // Handle the 'system_NUMBER' type of blocks
  if (strpos($delta, '_') === FALSE) {
    $display_type = $delta;
  }
  else {
    list($display_type, $display_number) = explode('_', $delta);
  }
  $forecast_days = (int) variable_get('weather_forecast_days', '2');
  switch ($display_type) {
    case 'user':
      if (weather_access_userblock()) {
        // Show the user's custom weather block, if there is already
        // a place configured. Otherwise, do not show the block.
        $places = weather_get_places_in_use('user', $user-&gt;uid);
        if (!$places) {
          return;
        }
        ...
        [from weather.module]


Is there a way of displaying a 'Please set your weather location' link, instead of nothing at all, without applying a patch to the module?

Thanks.
Use the hook_block_view_MODULE_DELTA_alter in your custom module to display text if user has not configured the custom location.you can access the current user object from global $user if you want to perform any operation on it.

/**
 * Implements hook_block_view_MODULE_DELTA_alter().
 */
function demo_wipe_block_view_weather_user_alter(&amp;$data, $block) {
//Check here that whether user has configured or not. 
  if(!is_array($data)) {
    $data['subject'] = t('Blah Blah Blah!');
    $data['content'] = t('Blah Blah Blah! link');
  }
}


P.S. : I have tested it on php 5.5.3

I think you should also specify this as a feature request in the module issue queue to set default whether location(that should be in admin configuration) on user whether block if user has not configured the block yet.