core-bundle/src/Resources/contao/dca/tl_page.php
public function checkRootType($varValue, Contao\DataContainer $dc)
	{
		if ($varValue != 'root' && $dc->activeRecord->pid == 0)
		{
			throw new Exception($GLOBALS['TL_LANG']['ERR']['topLevelRoot']);
		}

		return $varValue;
	}
public function checkRootType($varValue, Contao\DataContainer $dc)
	{
		if ($varValue != 'root' && $dc->activeRecord->pid == 0)
		{
			throw new Exception($GLOBALS['TL_LANG']['ERR']['topLevelRoot']);
		}

		return $varValue;
	}
Make sure that top-level pages are root pages

@param mixed                $varValue
@param Contao\DataContainer $dc

@return mixed

@throws Exception