Skip to content

Commit

Permalink
Fixed problem getting page id
Browse files Browse the repository at this point in the history
  • Loading branch information
sircxes committed Jan 7, 2021
1 parent 59d1274 commit 1049ad5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Listener/MelisFrontSiteConfigListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,22 @@ public function onLoadModulesPost(ModuleEvent $e)
if ($uri1 != 'melis')
{
$pageId = null;
// get page id
if ($tabUri[1] == 'id')
$pageId = $tabUri[2];
else if (isset($tabUri[3]) && $tabUri[3] == 'id')
$pageId = $tabUri[4];
//get page id
preg_match('/(\/id\/)(\D*)(\d+)/i', $uri, $matches);
if(empty($matches[3])){
$pageIdInfo = explode('/', $matches[0]);
$pageId = $pageIdInfo[2];
}else {
$pageId = $matches[3];
}

//get the config listener
$configListener = $e->getConfigListener();
//get the merged config
$config = $configListener->getMergedConfig(false);

/**
* get domain
* get domainA
*/
$domain = $_SERVER['SERVER_NAME'];
/**
Expand Down

0 comments on commit 1049ad5

Please sign in to comment.