core-bundle/src/Resources/contao/pages/PageRoot.php
protected function getNextPage($rootPageId)
	{
		$objNextPage = PageModel::findFirstPublishedByPid($rootPageId);

		// No published pages yet
		if (null === $objNextPage)
		{
			$this->log('No active page found under root page "' . $rootPageId . '")', __METHOD__, TL_ERROR);
			throw new NoActivePageFoundException('No active page found under root page.');
		}

		return $objNextPage;
	}
protected function getNextPage($rootPageId)
	{
		$objNextPage = PageModel::findFirstPublishedByPid($rootPageId);

		// No published pages yet
		if (null === $objNextPage)
		{
			$this->log('No active page found under root page "' . $rootPageId . '")', __METHOD__, TL_ERROR);
			throw new NoActivePageFoundException('No active page found under root page.');
		}

		return $objNextPage;
	}
Prepare the page object and redirect URL

@param integer $rootPageId

@return PageModel

@throws NoActivePageFoundException