diff --git a/.htaccess b/.htaccess
new file mode 100644
index 000000000..1c55a9a4e
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,13 @@
+# Disable index view
+Options -Indexes
+
+# Hide a specific file
+
+ Order allow,deny
+ Deny from all
+
+
+
+ Order allow,deny
+ Deny from all
+
diff --git a/config.xml b/config.xml
index 229ee0443..f7a037309 100644
--- a/config.xml
+++ b/config.xml
@@ -2,7 +2,7 @@
ps_mbo
-
+
diff --git a/ps_mbo.php b/ps_mbo.php
index 39620b7b7..6c709e6ac 100755
--- a/ps_mbo.php
+++ b/ps_mbo.php
@@ -53,7 +53,7 @@ class ps_mbo extends Module
/**
* @var string
*/
- public const VERSION = '4.4.3';
+ public const VERSION = '4.5.0';
public const CONTROLLERS_WITH_CONNECTION_TOOLBAR = [
'AdminPsMboModule',
@@ -104,7 +104,7 @@ class ps_mbo extends Module
public function __construct()
{
$this->name = 'ps_mbo';
- $this->version = '4.4.3';
+ $this->version = '4.5.0';
$this->author = 'PrestaShop';
$this->tab = 'administration';
$this->module_key = '6cad5414354fbef755c7df4ef1ab74eb';
diff --git a/src/Addons/Provider/LinksProvider.php b/src/Addons/Provider/LinksProvider.php
index 104e32364..f43dc459d 100644
--- a/src/Addons/Provider/LinksProvider.php
+++ b/src/Addons/Provider/LinksProvider.php
@@ -133,9 +133,12 @@ public function getCategoryLink(string $categoryName): string
{
$category = $this->getCategoryByName($categoryName);
- return $this->router->generate('admin_mbo_catalog_module', [
- 'filterCategoryRef' => $category ? $category->refMenu : '',
- ]);
+ $routeParams = [];
+ if ($category && 'other' !== mb_strtolower($categoryName)) {
+ $routeParams['filterCategoryRef'] = $category->refMenu;
+ }
+
+ return $this->router->generate('admin_mbo_catalog_module', $routeParams);
}
/**
diff --git a/src/Controller/Admin/ModuleRecommendedController.php b/src/Controller/Admin/ModuleRecommendedController.php
index d70121f85..421d310c5 100644
--- a/src/Controller/Admin/ModuleRecommendedController.php
+++ b/src/Controller/Admin/ModuleRecommendedController.php
@@ -23,7 +23,9 @@
use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;
use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
/**
@@ -47,14 +49,23 @@ public function __construct(
}
/**
- * @return JsonResponse
+ * @return JsonResponse|RedirectResponse
*/
- public function indexAction(): JsonResponse
+ public function indexAction(): Response
{
$response = new JsonResponse();
try {
- $tabCollection = $this->get('mbo.tab.collection.provider')->getTabCollection();
$tabClassName = $this->requestStack->getCurrentRequest()->get('tabClassName');
+ if (null === $tabClassName) { // In case the recommended modules page is requested without giving tab context, we redirect to Modules catalog page
+ $routeParams = [];
+ $query = \Tools::getValue('bo_query');
+ if (false !== $query && !empty(trim($query))) {
+ $routeParams['keyword'] = trim($query);
+ }
+
+ return $this->redirectToRoute('admin_mbo_catalog_module', $routeParams);
+ }
+ $tabCollection = $this->get('mbo.tab.collection.provider')->getTabCollection();
$tab = $tabCollection->getTab($tabClassName);
$context = $this->get('mbo.cdc.context_builder')->getRecommendedModulesContext($tab);
$context['recommendation_format'] = $this->requestStack->getCurrentRequest()->get('recommendation_format');
diff --git a/src/Service/View/ContextBuilder.php b/src/Service/View/ContextBuilder.php
index 48711f469..e773fcb07 100644
--- a/src/Service/View/ContextBuilder.php
+++ b/src/Service/View/ContextBuilder.php
@@ -177,6 +177,9 @@ private function getCommonContextContent(): array
'accounts_user_id' => $this->accountsDataProvider->getAccountsUserId(),
'accounts_shop_id' => $this->accountsDataProvider->getAccountsShopId(),
'accounts_token' => $this->accountsDataProvider->getAccountsToken(),
+ 'module_catalog_url' => $this->router->generate('admin_mbo_catalog_module'),
+ 'theme_catalog_url' => $this->router->generate('admin_mbo_catalog_theme'),
+ 'php_version' => phpversion(),
];
}
diff --git a/translations/de-DE/ModulesMboErrors.de-DE.xlf b/translations/de-DE/ModulesMboErrors.de-DE.xlf
index 74121a6bd..7d1122e68 100644
--- a/translations/de-DE/ModulesMboErrors.de-DE.xlf
+++ b/translations/de-DE/ModulesMboErrors.de-DE.xlf
@@ -5,7 +5,7 @@
PrestaShop konnte sich nicht bei Addons anmelden. Überprüfen Sie bitte Ihre Zugangsdaten und Ihre Internetverbindung.
- Line: 105
+ Line: 104