Ody Mandrell Posted June 25, 2021 Posted June 25, 2021 Hi, What could be the reason behind the non-updating comment counter in the forum statistics block at the bottom of the main page? I rewrote the short format of the post counter to a long format, then this error occured.
Adriano Faria Posted June 25, 2021 Posted June 25, 2021 Widgets are cached and updated from time to time. There’s a setting on ACP to control the number of minutes. Or isn’t updating at all?
Ody Mandrell Posted June 26, 2021 Author Posted June 26, 2021 (edited) Thanks for the answer! It updates once a day. Edited June 26, 2021 by Ody Mandrell
Ody Mandrell Posted June 27, 2021 Author Posted June 27, 2021 @Adriano Faria What do you suggest? Is there a solution to the problem outlined above?
Andy135 Posted June 29, 2021 Posted June 29, 2021 On 6/25/2021 at 7:30 AM, Ody Mandrell said: Hi, What could be the reason behind the non-updating comment counter in the forum statistics block at the bottom of the main page? I rewrote the short format of the post counter to a long format, then this error occured. I did the same as you and I'm also seeing the same issue. Changed the Forum Stats block from short to long format and now it doesn't refresh when the cache refreshes (ours is set to refresh every 4 minutes). I can get it to refresh if I edit and re-save the block, or if I delete and re-install the block using the Block Manager. Does anyone have any suggestions to fix this? Please don't say revert back to short format post and topic counts 😬 Ody Mandrell 1
opentype Posted June 29, 2021 Posted June 29, 2021 Are you guys sure that this behaviour started after your changes? And how are those changes made anyway? I wouldn’t be surprised if those values were always cached and your action didn’t change a thing regarding the updating.
Nathan Explosion Posted June 29, 2021 Posted June 29, 2021 (edited) *whistles* /** * @brief Cache Expiration - 24h */ public $cacheExpiration = 86400; *whistles* Edited June 29, 2021 by Nathan Explosion opentype 1
Andy135 Posted June 29, 2021 Posted June 29, 2021 48 minutes ago, opentype said: Are you guys sure that this behaviour started after your changes? And how are those changes made anyway? I wouldn’t be surprised if those values were always cached and your action didn’t change a thing regarding the updating. Here's where I changed the format from "short" to "long". I can't be 100% certain that it wasn't refreshing as expected before changing the format from short to long, given that the short format doesn't show individual post increments so naturally would take longer to show an increase in post count from X.2k to X.3k posts, for example. And the block cache settings are set to reload every 4 minutes. 48 minutes ago, Nathan Explosion said: *whistles* /** * @brief Cache Expiration - 24h */ public $cacheExpiration = 86400; *whistles* @Nathan Explosion, that's both helpful and not, all at the same time. What I think you're saying is that with the introduction of the new "short" format post count there is a global cache expiration setting which overrides the ACP cache refresh setting (below), and it's the global cache expiration that now needs to be adjusted once the post count format has been changed to "long"? If I have this right, can you show us where you found that snippet so that we can adjust it to a duration that makes more sense for long format post counts please?
Nathan Explosion Posted June 29, 2021 Posted June 29, 2021 (edited) 13 minutes ago, Andy135 said: What I think you're saying is that What I am saying is that the widget now has a 24 hour cache expiration - I'm not tying it to any other change (you can, if you wish, but I am not) Widget files are stored in the applications\<application>\widgets folder on your installation - up to you if you want to manually modify the file, but I personally wouldn't and instead I would have looked at modifying it using a plugin instead (probably not an option for you) Edited June 29, 2021 by Nathan Explosion
Andy135 Posted June 29, 2021 Posted June 29, 2021 40 minutes ago, Nathan Explosion said: What I am saying is that the widget now has a 24 hour cache expiration - I'm not tying it to any other change (you can, if you wish, but I am not) Widget files are stored in the applications\<application>\widgets folder on your installation - up to you if you want to manually modify the file, but I personally wouldn't and instead I would have looked at modifying it using a plugin instead (probably not an option for you) Our site is on a cloud-based subscription and I don't seem to have that folder so can't find the widget file. Curious to know why you think a plugin wouldn't be an option for us?
Nathan Explosion Posted June 29, 2021 Posted June 29, 2021 (edited) 59 minutes ago, Andy135 said: Curious to know why you think a plugin wouldn't be an option for us? The comment that you made about editing the file kind of gives the indication that you may not know how to create a plugin - if that is incorrect, and you can create a plugin, then hook into \IPS\forums\widgets\forumStatistics and modify the $cacheExpiration variable that way. However, as you've now said "Our site is on a cloud-based subscription" then I'm guessing that means IPS hosted...so editing the file and also creating the plugin are out the window unfortunately. Edited June 29, 2021 by Nathan Explosion
Andy135 Posted June 29, 2021 Posted June 29, 2021 12 minutes ago, Nathan Explosion said: The comment that you made about editing the file kind of gives the indication that you may not know how to create a plugin - if that is incorrect, and you can create a plugin, then hook into \IPS\forums\widgets\forumStatistics and modify the $cacheExpiration variable that way. However, as you've now said "Our site is on a cloud-based subscription" then I'm guessing that means IPS hosted...so editing the file and also creating the plugin are out the window unfortunately. Happy to put something together for you, if you want? You have PM. 👍
Recommended Posts