Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I am having an issue that appears when I turn on Drupal caching. After voting on a block view, if an anonymous user views that same block, instead of seeing the results, they see the voting form again. If they try to vote a second time, it will give them an error message saying they've already voted, and still they can't see the results. Once cache clears, then it operates as normal and they can finally see the results.
Thanks in advance.
Comments
Comment #1
mario_prkos CreditAttribution: mario_prkos commentedYes, the problems lies that hole page is cached so when anonymous user try to get page drupal will serve one form the cache but not new one (where is already voted). Try to use authcache it will give you more control what should cached and what not. Meanwhile I will see how can I improve page caching issue. I also have same problem so I am on it.
Mario
Comment #2
mario_prkos CreditAttribution: mario_prkos commentedTry out dev version it now has some improvement and let me know is there any problem.
Comment #3
Docc CreditAttribution: Docc commentedI can confirm this problem still exist.
If cache is enabled some strange things happen for anonymous voters with cookie filtering enabled.
Comment #4
matharts CreditAttribution: matharts commentedI confirmed this is still an issue. Turning off caching on site fixed issue of the results showing before a person voted when Anonymous voting is set to Allowed filtered by user cookie.
Comment #5
sillygwailoA workaround for a case-by-case basis is to use CacheExclude to exclude the paths of the nodes that have active polls on them. That way you can still have caching enabled except for the nodes that at the moment require them to be turned off.