J3 Issue ?
avatar Spudley
Spudley
29 Oct 2018

Steps to reproduce the issue

  • Turn on caching on a Joomla site.
  • Turn on the content ratings feature.
  • Now go try to give vote ratings for some of your content. Especially ones that have not previously been rated.

Expected result

When I give a rating for a piece of content, I expect the page to reload and to show me a star rating for that article which takes into account the score I gave it.

Actual result

What actually happens is that the cached version of the page is served, and so I just see the same score as before. If it wasn't rated before, this means that I still see "No ratings yet" even though I also have a message on the page saying thank you for rating this article.

System information (as much as possible)

Tested with an up-to-date Joomla version (3.8.13).

Additional comments

The fix would seem to be to add some code to the ratings feature to make it flush the cache for the current article when a rating is saved.

avatar Spudley Spudley - open - 29 Oct 2018
avatar joomla-cms-bot joomla-cms-bot - change - 29 Oct 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Oct 2018
avatar brianteeman brianteeman - change - 30 Oct 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 30 Oct 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

does this Issue exist on latest Version?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22858.

avatar Spudley
Spudley - comment - 4 Mar 2019

Hi Franz. I've just re-tested it on the latest version (3.9.3) and yes, the problem remains the same.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Mar 2019

@Spudley thanks for test again > @HLeithner can you please comment?

avatar HLeithner
HLeithner - comment - 5 Mar 2019

I don't see a clear function in our cache layer... maybe @mbabker can help?

avatar mbabker
mbabker - comment - 5 Mar 2019

There is a partially implemented Joomla\CMS\Cache\CacheStorage::flush() method, that should probably be exposed through Joomla\CMS\Cache\Cache too.

But that's overkill for this. A vote operation needs to clean the com_content cache group and the cache for relevant modules. Essentially, the frontend article model needs to have the storeVote method call $this->cleanCache() and the extended cleanCache() method from the admin article model copied to the frontend class to ensure all appropriate groups are cleaned.

avatar brianteeman
brianteeman - comment - 5 Mar 2019

There might be some help looking in the hits code. as I remember @rdeutz did some work on it that sounds like it was tackling the same root issue

avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Mar 2019
Status Information Required Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Category com_content
avatar SharkyKZ
SharkyKZ - comment - 14 Jun 2019

Test PR #25201 please.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Jun 2019

Closed as having Pull Request #25201

avatar franz-wohlkoenig franz-wohlkoenig - close - 14 Jun 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Jun 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-06-14 09:01:13
Closed_By franz-wohlkoenig

Add a Comment

Login with GitHub to post a comment