1. GGGolf
  2. SP Weather (Module)
  3. Thursday, 13 June 2019
I'm trying to activate the new weather module (latest version) on a website and it always works the first time I load the page after saving the module. After, I alway get this error: Can't current decode data. Also, make sure your API key and location is correct. MOD_SPWEATHER_ERROR_PLATFORM_YAHOO.

I tried all the platforms and they all do the same, work once then give me the error message.

Is there anything I have to do to make it work?

(also, it'd be nice to have the weather display without the decimals 17 instead of 17.22 for example.)

Thanks!
Responses (4)
Accepted Answer Pending Moderation
Hi,
Thanks for your query. I've checked it in my end and didn't find any issue here. Please make sure that you are using different API for different API platforms. You can use this openWeatherMap API 554348026706259352d167e514b815a1 to check the issue.


-Best Regards
  1. more than a month ago
  2. SP Weather (Module)
  3. # 1
Accepted Answer Pending Moderation
The issue is still there with that new API.

We looked into the problem, and it seems like the error is caused by helper.php line 257
file_put_contents($cache_file, $results['data'], LOCK_EX);
the LOCK_EX causes the cache file to be written empty on the disk so when it reloads the cache, it fails and it doesn't seem like there is a mechanism in place to get new data when the cache is empty/unreadable.

Why is the LOCK_EX necessary? Our server is using NFS and NFS doesn't support locks. Here: https://stackoverflow.com/questions/218451/locking-nfs-files-in-php

Could maybe this
if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 60 * $this->cache_time ))) {
$results['data'] = JFile::read($cache_file);
} else {
}
be changed to this? (remove the esle)
if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 60 * $this->cache_time ))) {
$results['data'] = JFile::read($cache_file);
}
if ($results['data'] == null || strlen($results['data']) == 0) {
}

We fixed it temporarily and it works, but that will get overwritten with the next update. Could we get some sort of option in the module for that?

Thanks
  1. more than a month ago
  2. SP Weather (Module)
  3. # 2
Accepted Answer Pending Moderation
Thanks for your reply. I'm informing our development team about that and soon they'll take care of this issue.

-Best Regards
  1. more than a month ago
  2. SP Weather (Module)
  3. # 3
Accepted Answer Pending Moderation
I'm trying to activate the new weather module (latest version) on a website and it always works the first time I load the page after saving the module. After, I alway get this error: Can't current decode data. Also, make sure your API key and location is correct. MOD_SPWEATHER_ERROR_PLATFORM_YAHOO.

I tried all the platforms and they all do the same, work once then give me the error message.

Is there anything I have to do to make it work?

(also, it'd be nice to have the weather display without the decimals 17 instead of 17.22 for example.)

Thanks!



Did you succeed in cutting off the decimals of the temperature?
  1. more than a month ago
  2. SP Weather (Module)
  3. # 4


There are no replies made for this post yet.
Be one of the first to reply to this post!


This forum is archived

This forum has been archived. Please use JoomShaper official support system.