Form post data not being passed through with full page caching on

Permalink
Hi all,

Bit of a strange issue I'm trying to get to the bottom of. I have a drop down navigation block which is populated with the page list model. The value of the drop down is the cID of the pages. This is then POSTed to the following function:

public function action_findcourse() {      
   $pageid = $this->post("subjects");
   //Check for valid pageID
   if(is_numeric($pageid)) {
      //Get URL path of page
      $url = Page::getCollectionPathFromID($pageid);
      //Serve redirect header
      header( 'Location: ' . $url ) ;
      exit;
   } else {
      //Something weird is going on...
      header( 'Location:http://www.suffolkone.ac.uk' ) ;
   }
}


This will work fine for a day or two and will sucessfully redirect. However, after, it will just not do anything like the function has not been executed and return to the page when the POST was sent. Clearing the cache solves the issue for another day or two then it's rinse and repeat?

Can anyone enlighten to this funky behaviour?

Thanks D.

 
Remo replied on at Permalink Reply
Remo
What kind of block is this? A custom one you created yourself?

Why am I asking this? There are a couple of variables in the controller of a block:
protected $btCacheBlockRecord = true;
protected $btCacheBlockOutput = true;
protected $btCacheBlockOutputOnPost = true;
protected $btCacheBlockOutputForRegisteredUsers = false;
protected $btCacheBlockOutputLifetime = 300;


If you set $btCacheBlockOutputOnPost to true, it would certainly cause some issues..
daaahhnuh replied on at Permalink Reply
Indeed it's a custom block. I've tried adding those in before and it doesn't fix it. POST cache was always set to false. However, I took it out from reading up on full page caching... It overides the settings anyway doesn't it?

D.
Remo replied on at Permalink Reply
Remo
Not completely. It checks if the whole page is cache-able depending on the block settings. If you enable the full page cache, you should still be able to use it on certain pages. This is at least if you don't run into the issue you have.

Is this a "secret" block? Solving this in theory is a bit tricky!