I have a site that I upgraded from 2.3.7 to 2.4.5. On the site I use the URLParams['Action'] in my controller. However since the upgrade I get a page not found error because 2.4.5 doesn't seem to handle the URLParams the same as 2.3.7.
I am not actually using the Action as an action on the controller just as a way to pass variable data in to the index action.
My url looks like this:
http://example.com/locations/3
In my script I have this code which is called from the template in a public function. But the function never gets called because the page is redirected to page not found because the site thinks that I am asking for a page with the urlSegment of 3 that is a child of Locations. At least that is what I think. I have //SiteTree::enable_nested_urls(); in my config so it should not see the third section of the url as a link but instead as the action.
if ($this->URLParams['Action']){
$clinic = DataObject::get_by_id('Clinic', $this->URLParams['Action']);
if ($clinic){
return $clinic;
}
}
else {
$clinic = DataObject::get_one('Clinic', "Name = 'Spokane Clinic'");
if ($clinic){
return $clinic;
}
}
return false;
Does 2.4.5 have a different way of parsing the url?