protected function removeEmptyDetailPages($jumpTos) { // Remove the detail pages. foreach ($jumpTos as $jumpTo) { // Get the page from the url. $event = new GetPageDetailsEvent($jumpTo['value']); $this->getEventDispatcher()->dispatch(ContaoEvents::CONTROLLER_GET_PAGE_DETAILS, $event); $pageDetails = $event->getPageDetails(); // Check if we have a page If not go to the next one. if ($pageDetails === null) { continue; } // Make a full url from it. $baseUrl = $this->getBaseUrl($pageDetails); if (($strKey = array_search($baseUrl->getUrl(), $this->foundPages)) !== false) { unset($this->foundPages[$strKey]); } // Make a full url from it without the https. $baseUrl = $this->getBaseUrl($pageDetails, null, true); if (($strKey = array_search($baseUrl->getUrl(), $this->foundPages)) !== false) { unset($this->foundPages[$strKey]); } } }