The forecast image for code 34 Sunny wasn't showing up. It appears that it's because it is adding the prefix "day." So the image name would have to be "day-day-clear.png."
I altered my copy of the module to get it to work.
Starting at line 293, I changed the code to:
if (!(($value['code'] >= 27 && $value['code'] <= 34) || $value['code'] == 3200)) {
$prefix = "$daylight-";
$src = drupal_get_path('module', 'yahoo_weather_forecast') . "/images/$prefix". $img['file'];
} else {
$src = drupal_get_path('module', 'yahoo_weather_forecast') . "/images/". $img['file'];
}
Can someone confirm that this is the way it should work?
Comments
Comment #1
Pedro Lozano commentedYou code fix it but not in the correct way because the module always adds the prefix but if the "if" condition is not met then the $prefix variable will be empty and the prefix is not added.
The problem is that the $prefix is not initialized properly and may be set from a previous assignation, so even if the condition is not met the prefix has a value from a previous assignation. The solution is to make a $prefix = '' before the condition.
Fixed and commited. Thanks.