Hi there
I'm upgrading a 2.4 site to 3.4
I currently have the following code to check if page content exists and, if not, redirect to the first child page:
if(!$this->dbObject('Content')->hasValue()){
if($this->Children()->Count()){
Director::redirect($this->Children()->First()->AbsoluteLink());
}
}
I understand that Director::redirect() is deprecated so have replaced that line with:
return $this->redirect($this->Children()->First()->AbsoluteLink());
This works to redirect the page, but if I have content in the parent, it still redirects to the first child.
I'm assuming there is something wrong with the first line of code above that needs to be updated too?
Many thanks
Grant