Head scratcher - Global Area (Stack) flip flops between states

Permalink
I've built a site where the footer contains two different stacks, one that has a <ul> of links (i.e. footer menu) and the other stack is used to display a random testimonial from Cube Testimonials.

The interesting symptom is that at each page load it flip-flops between the current version and the previous version. Not just one block/stack but both.

Version: 5.6.1.2

Yes, I've cleared the cache and deleted the older versions ... if I just reload the view of the stack in the backend it randomly picks a testimonial but doesn't show the same problem that it does on the front-end.

Has anyone ever seen this or encountered something similar? The client is getting antsy to finish off the site.

spooker
 
spooker replied on at Permalink Reply
spooker
Forgot to mention, this "only" happens on the home page, all other pages on the site display the footer consistently.

Yes, all page types are using the same elements/footer.php reference.
A3020 replied on at Permalink Best Answer Reply
A3020
No, I've never had such a problem. What happens if you simply delete the older versions of the stack?

And, does it also happen if you request the stack in your template with code?

<?php
$s = Stack::getByName('....');
$s->display($c);
?>

Cheers, Adri
spooker replied on at Permalink Reply
spooker
Changing my code from "new GlobalArea(...)" to "Stack::getByName(...)" as you suggested has fixed the behavior. Will have to remember that for future projects.

Thanks!
JohntheFish replied on at Permalink Reply
JohntheFish
This does sound like a cache problem. Rather than just clearing the block cache, have you tried switching it off completely?

With the stacks, have you approved the stack versions? (as well as the page version you are showing them on).

Does the behaviour change depending on whether you are logged in or not?

Does the behaviour change if you enter the page via a 'Post' request rather (eg via a form) than the usual 'Get' request (via a url)?
spooker replied on at Permalink Reply
spooker
The caching had already been turned completely off. The stack had been approved. No change if I am logged in or not. And I can't expect people to hit the home page with POST.
JohntheFish replied on at Permalink Reply
JohntheFish
I wasn't suggesting POST as a solution, but as an experiment that may help identify the cause.