/**
  * Retrieve the page path for the given page-id.
  * If the page is a shortcut to another page, it returns the page path to the shortcutted page.
  * MP get variables are also encoded with the page id.
  *
  * @param array $paramKeyValues GETvar parameters containing eg. "id" key with the page id/alias (passed by reference)
  * @param array $pathParts Path parts array (passed by reference)
  * @return void
  * @see encodeSpURL_pathFromId()
  */
 protected function IDtoPagePath(array &$paramKeyValues, &$pathParts)
 {
     $pageId = $paramKeyValues['id'];
     unset($paramKeyValues['id']);
     $mpvar = (string) $paramKeyValues['MP'];
     unset($paramKeyValues['MP']);
     // Convert a page-alias to a page-id if needed
     $pageId = $this->resolveAlias($pageId);
     $pageId = $this->resolveShortcuts($pageId, $mpvar);
     if ($pageId) {
         // Set error if applicable.
         if ($this->isExcludedPage($pageId)) {
             $this->pObj->setEncodeError();
         } else {
             $lang = $this->getLanguageVar($paramKeyValues);
             $cachedPagePath = $this->getPagePathFromCache($pageId, $lang, $mpvar);
             if ($cachedPagePath !== false) {
                 $pagePath = $cachedPagePath;
             } else {
                 $pagePath = $this->createPagePathAndUpdateURLCache($pageId, $mpvar, $lang, $cachedPagePath);
             }
             // Set error if applicable.
             if ($pagePath === '__ERROR') {
                 $this->pObj->setEncodeError();
             } else {
                 $this->mergeWithPathParts($pathParts, $pagePath);
             }
         }
     }
 }