First off I just wanted to thank you for creating this module.
I am new to all this so please forgive me if I say something incorrect about how your module works.
I downloaded the newest update and after installing it, I noticed that the weather block was not appearing on my front page. I then checked the module permissions and changed it to anonymous and authenticated user to view the nws_weather display. It however still did not appear on my website's front page. In the end I just change the following sub to display the block all the time.
/**
* Implements hook_block_view().
*/
function nws_weather_block_view($delta = '') {
$block = array();
// if (user_access('access nws_weather')) {
switch ($delta) {
case 'mdf':
$forecastdata = nws_weather_NDFDgenByDay(variable_get('nws_weather_lat', NWS_WEATHER_LAT_DEFAULT), variable_get('nws_weather_lon', NWS_WEATHER_LON_DEFAULT), '', variable_get('nws_weather_daily_days', NWS_WEATHER_DAILY_DAYS_DEFAULT));
$location = check_plain(variable_get('nws_weather_location_name', NWS_WEATHER_LOCATION_NAME_DEFAULT));
$block = array(
'subject' => $location ? t('Weather Forecast for !location', array('!location' => $location)) : t('Weather Forecast'),
'content' => $forecastdata
? theme('nws_weather_forecast', array(
'dataForecast' => $forecastdata,
'required' => array('Daily Maximum Temperature', 'Daily Minimum Temperature', 'Conditions Icons', ),
'display' => array('Conditions Icons', 'Weather Type, Coverage, and Intensity', 'Daily Maximum Temperature', 'Daily Minimum Temperature', )
))
: t('Forecast data not currently available'),
);
}
//}
return $block;
}
I know this is not correct but could only get the block to display as an admin no matter what I did in the admin configs. Once again thanks and sorry if this was some kinda of newbie error on my part.
Comments
Comment #1
dwaine commentedHi HFloyd,
I retested the code and cannot duplicate your issue. Based on your change to the function it appears the issue is permissions related. Have you verified that:
1. The permissions in the block are correct? The block itself has both 'content type' and 'Roles' visibility options. Is it possible the block role permissions have inadvertently been set to 'administrator'?
2. After changing these permissions did you clear Drupal's cache?
If you are still having issues please let me know what you've found.
Thanks
Dwaine
Comment #2
hfloyd commentedI changed the code back to the original and cleared the cache. That seamed to fix the problem. Sorry for the mistake and thanks for your help.
Comment #3
dwaine commentedHi HFloyd,
No problem. Glad we got it working for you.
Dwaine