Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rbbrioso28 committed Jun 18, 2019
2 parents 36dfb70 + 1636aa5 commit bf6da20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/Controller/Plugin/MelisFrontSearchResultsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public function front()

$moduleDirectory = '';
$searchModulePath = self::SEARCH_PATH_MELIS_SITES;

$newModuleName = $moduleName;

if (!is_null($moduleName)) {
/**
* Folder names inside vendor/melisplatform is in lowercase-delimited-by-hyphens
Expand All @@ -100,10 +103,12 @@ public function front()
if (is_dir($_SERVER['DOCUMENT_ROOT'] . self::MELIS_SITES . $moduleName)) {
/** Module is located inside MelisSites folder. Ex. $moduleName = "MelisDemoCms" */
$moduleDirectory = $_SERVER['DOCUMENT_ROOT'] . self::MELIS_SITES . $moduleName;
$newModuleName = $moduleName;
} elseif (is_dir($_SERVER['DOCUMENT_ROOT'] . self::VENDOR . $vendorSiteName)) {
/** Module is located inside Vendor folder. Ex. $moduleName = "melis-demo-cms" */
$moduleDirectory = $_SERVER['DOCUMENT_ROOT'] . self::VENDOR . $vendorSiteName;
$searchModulePath = self::SEARCH_PATH_VENDOR;
$newModuleName = $vendorSiteName;
} else {
$siteDirExist = false;
}
Expand Down Expand Up @@ -137,7 +142,7 @@ public function front()
// Get the current server protocol
$protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'http://';

$indexUrl = $protocol . $_SERVER['SERVER_NAME'] . '/melissearchindex/module/' . $moduleName . '/pageid/' . $mainPageId . '/exclude-pageid/0';
$indexUrl = $protocol . $_SERVER['SERVER_NAME'] . '/melissearchindex/module/' . $newModuleName . '/pageid/' . $mainPageId . '/exclude-pageid/0';
} else {
$moduleDirWritable = false;
}
Expand All @@ -149,7 +154,7 @@ public function front()
if ($isIndex && $keyword) {
/** @var \MelisEngine\Service\MelisSearchService $searchSvc */
$searchSvc = $this->getServiceLocator()->get('MelisSearch');
$searchresults = $searchSvc->search($keyword, $moduleName, true, $searchModulePath);
$searchresults = $searchSvc->search($keyword, $newModuleName, true, $searchModulePath);
if (!empty($searchresults)) {
$searchresults = str_replace('&', '&', $searchresults);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ function(MvcEvent $e){
$this->createTranslations($e, $datasPage->getMelisTemplate()->tpl_zf2_website_folder,
$datasPage->getMelisPageTree()->lang_cms_locale);
// create translations for loaded modules
$this->createTranslationsOfLoadedModules($e,$datasTemplate->tpl_site_id,$pageTree->lang_cms_locale);
if ($routingResult['renderMode'] == 'front') {
$this->createTranslationsOfLoadedModules($e,$datasTemplate->tpl_site_id,$pageTree->lang_cms_locale);
}
$this->initSession($datasPage->getMelisTemplate()->tpl_zf2_website_folder);
}

Expand Down

0 comments on commit bf6da20

Please sign in to comment.