Forecast IO Missing Icons [Solved]

Possible a bug in the version of PHP being used??

PHP Bug #68118 $a->foo .= ‘test’; can leave $a->foo undefined

I added

settype($expires, "integer");

above line line 945 and it seemed to do the trick. Not sure if this messes anything else up, is appropriate, or what not.

Thinking about that more, that is not the way to fix this.

EDIT:

if(empty($expires)){settype($expires, "integer");}

Is probably better, still may not be correct, or right.

The problem is actually here:

https://github.com/xibosignage/xibo-cms/blob/develop/lib/data/media.data.class.php#L831

This line should be:

$this->addModuleFile($folder . DIRECTORY_SEPARATOR . $file, 0, true, $force);

Forcing it to an integer would have hidden this problem, which probably isn’t what you want - so you may want to revert your fix.

1 Like

Logged in Github issues:

Changing the line listed above by Dan fixed my problem.

2 Likes

Dan,

Thank you very much for the fix. :smile:

I will revert my changes and apply the fix.

1 Like

Hi folks,

I’m having another problem of missing icons with the Windows client.
In the Forecast IO 5 day layout, we wanted to integrate animated gif icon instead of the default webfont.
It works well in the CMS preview, but the windows client still shows the webfont icon.

On the client information window, we can see the gif icons have been well downloaded as it appears in the Required files Status.

Moreover, the client freeze on the Forecast layout and doesn’t show anything else after that.

We’ve made the correction below supplied by Dan in the code. We’ve ran the Verify All function as well…

Any idea of what’s happening ?

Sounds like a cache issue to me. I would try deleting all temp files and browser caches. Also possible try completely closing out of the Xibo client and restarting it.

Done all that (by the way, is there any way to delete cache in the Xibo client ?), nothing changed.
Something else please ?
@dan or @alex , any idea ?

Footspots,

Android xibo cache is cleared in Settings, Apps, Xibo. Careful what you clear or you will need to re-setup your connection to the CMS. I have always just restarted the Android device, it has always worked for me with Android and Xibo.

Are any errors logged in the log with audit on in respect to the layout, or screens? Do you have audit turned on, on the screens?

What does your code look like when calling the icon / images?

CSlaughter,

I’m talking about the Windows client, I didn’t get the chance to make any test on the Android client to know if the problem exists as well. I’m using Xibo Player on my Desktop.

There are no errors in the log about the layout or screens. How do you turn the audit on the screen ? As shown on the previous post on the screenshot, the client information window (if you’re talking about that…) shows the icons are in the request files status.

This is what we’ve done so far :

We’ve changed the code from the file “forecastio.module.php” to create a class called “firstwi”. This has been done for to display the weather of the current day.

$data = json_decode(json_encode($data), true);

        // Process the icon for each day
        for ($i = 0; $i < 7; $i++) {
            $data['daily']['data'][$i]['wicon'] = (isset($icons[$data['daily']['data'][$i]['icon']]) ? $icons[$data['daily']['data'][$i]['icon']] : $icons['unmapped']);
      if ($i==0) { $data['daily']['data'][$i]['wicon'] = " first".$data['daily']['data'][$i]['wicon']; }
            $data['daily']['data'][$i]['temperatureMaxFloor'] = (isset($data['daily']['data'][$i]['temperatureMax'])) ? floor($data['daily']['data'][$i]['temperatureMax']) : '--';
            $data['daily']['data'][$i]['temperatureMinFloor'] = (isset($data['daily']['data'][$i]['temperatureMin'])) ? floor($data['daily']['data'][$i]['temperatureMin']) : '--';
            $data['daily']['data'][$i]['temperatureFloor'] = ($data['daily']['data'][$i]['temperatureMinFloor'] != '--' && $data['daily']['data'][$i]['temperatureMaxFloor'] != '--') ? floor((($data['daily']['data'][$i]['temperatureMinFloor'] + $data['daily']['data'][$i]['temperatureMaxFloor']) / 2)) : '--';
        }

        return $data;

To display that, in the CSS file, we create 2 types of icons, one for the class first-wi and the other one for the default class wi-.

The CSS file is called : weather-icons.min.css

Exemple given for the rain icon :

  .firstwi-rain:before {
    content: "";
    display: block;
    background: url("wi-rain.gif") no-repeat;
    float: left;
    margin: -50px 40px 0 0;
    width: 450px;
    height: 400px;
}
.wi-rain:before {
    content: "";
    display: block;
    background: url("wi-rain-small.gif") no-repeat;
    float: left;
    margin: 0 6px 0 0;
    width: 140px;
    height: 125px;
}

And that’s it !

Footspots,

The Clearing of the Android Cache was in reponse to:

(by the way, is there any way to delete cache in the Xibo client ?)

To turn on the Audit for the screen itself, go to diplays, click on the drop down arrow, select edit, goto the Advanced tab. you will see an Audit option.

You are trying to use two icon sets on the same region layout?? I am not sure that is supported. What do you have set for icons under the appearance tab on Forcast IO?

Maybe try combining the icon sets into one set? That is what I did after examine the exact code you posted from forecastio.module.php. That won’t work because you are wanting to use Gifs.

Footspot,

Have you tried removing:

content: "";

From your code?

What do you have in the two other text blocks for code under the appearance tab?

Why have you changed that file? I am not clear at all what you are trying to achieve by changing that - it will almost certainly be your problem though as that file is “installed” in the CMS library. To update your changes you would need to use Verify All in the Modules section.

I think you actually want to add your CSS to the Forecast Template (using the override template option).

I’m even more confused by this :smile: you should only need to change the template using “override template” in order to add presentational stuff

To give you more explanations, on the default template, the icons are sourced on webfont. To substitute the webfont icon based to the gif animated icons, we have to modify the weather-icons.min.css file, which we can’t edit from the CMS.

Anyway, even when putting back the default files and using the “Override the template” option, the problem remains the same, and the webfont icons are still displayed and not the gif animated ones.
Once again, there is no issue in the preview of the layout, the gif animated icons are well displayed.

We can see the icons are loaded in the client, in the Required Files Status. But the client keeps showing the default webfont based icons. And it has been tested with both Android an Windows client now. The Android client never displayed the template before. So I assume it’s not coming from a cache issue…

Could there be anything in the client code that prevent to display the gif icons instead of the webfont based icons in this template ?

Footspots,

Can you please post the coding you are using to over-ride the template? It is hard to say what problem you are having if we can’t see what you are trying.

Actually you don’t - you need to provide the icon set in the modules\theme\forecastio\weather_icons folder and then use the CSS in the template override to select the correct sprite position for the weather condition.

This is almost certainly the issue as I don’t think all players will play animated GIFs (android definitely won’t)