diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index cfd7a8f34..dc646c6af 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -44,4 +44,4 @@ jobs: - name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }}) run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }} - name : Run PHPStan - run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.11.19 analyse --configuration=/web/module/tests/phpstan/phpstan.neon + run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.11.19 analyse --configuration=/web/module/tests/phpstan/phpstan-${{ matrix.presta-versions }}.neon diff --git a/README.md b/README.md index 0fc637df4..b8c38532f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # MBO +![PHP tests](https://github.com/PrestaShopCorp/ps_mbo/workflows/PHP%20tests/badge.svg) +![Build & Release draft](https://github.com/PrestaShopCorp/ps_mbo/workflows/Build%20&%20Release%20draft/badge.svg) +[![GitHub license](https://img.shields.io/github/license/PrestaShopCorp/ps_mbo)](https://github.com/PrestaShopCorp/ps_mbo/LICENSE.md) + PrestaShop Marketplace in your Back Office ## About -Discover the best PrestaShop modules to optimize your online store. +Browse the Addons marketplace directly from your back office to better meet your needs. ## Reporting issues diff --git a/config.xml b/config.xml index ee7d0bde7..b0ad99f8f 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ ps_mbo - + diff --git a/logo.png b/logo.png index 062f8afc4..a734babca 100644 Binary files a/logo.png and b/logo.png differ diff --git a/ps_mbo.php b/ps_mbo.php index e3b3d6632..32110d950 100644 --- a/ps_mbo.php +++ b/ps_mbo.php @@ -139,7 +139,7 @@ class ps_mbo extends Module public function __construct() { $this->name = 'ps_mbo'; - $this->version = '2.0.1'; + $this->version = '2.0.2'; $this->author = 'PrestaShop'; $this->tab = 'administration'; $this->module_key = '6cad5414354fbef755c7df4ef1ab74eb'; @@ -152,7 +152,7 @@ public function __construct() parent::__construct(); $this->displayName = $this->l('PrestaShop Marketplace in your Back Office'); - $this->description = $this->l('Discover the best PrestaShop modules to optimize your online store.'); + $this->description = $this->l('Browse the Addons marketplace directly from your back office to better meet your needs.'); } /** @@ -163,7 +163,17 @@ public function __construct() public function install() { return parent::install() - && $this->registerHook(static::HOOKS) + && $this->registerHook(static::HOOKS); + } + + /** + * Enable Module. + * + * @return bool + */ + public function enable($force_all = false) + { + return parent::enable($force_all) && $this->installTabs(); } @@ -232,13 +242,13 @@ public function installTab(array $tabData) } /** - * Uninstall Module. + * Disable Module. * * @return bool */ - public function uninstall() + public function disable($force_all = false) { - return parent::uninstall() + return parent::disable($force_all) && $this->uninstallTabs(); } diff --git a/src/ModuleCollectionDataProvider.php b/src/ModuleCollectionDataProvider.php index 528aa4959..09487ddf3 100644 --- a/src/ModuleCollectionDataProvider.php +++ b/src/ModuleCollectionDataProvider.php @@ -123,6 +123,10 @@ public function getData(array $moduleNames) $module->set('type', 'addonsPartner'); } + if (!empty($module->get('description'))) { + $module->set('description', html_entity_decode($module->get('description'), ENT_QUOTES)); + } + $module->fillLogo(); $data[$module->get('name')] = $this->modulePresenter->present($module); } diff --git a/tests/phpstan/phpstan.neon b/tests/phpstan/phpstan-1.7.5.0.neon similarity index 100% rename from tests/phpstan/phpstan.neon rename to tests/phpstan/phpstan-1.7.5.0.neon diff --git a/tests/phpstan/phpstan-latest.neon b/tests/phpstan/phpstan-latest.neon new file mode 100644 index 000000000..5cfcb5f07 --- /dev/null +++ b/tests/phpstan/phpstan-latest.neon @@ -0,0 +1,11 @@ +parameters: + bootstrap: tests/phpstan/bootstrap.php + paths: + - src + - ps_mbo.php + dynamicConstantNames: + - _PS_VERSION_ + ignoreErrors: + - '#Parameter \#1 \$idProfile of static method ProfileCore::getProfileAccess\(\) expects int, string given.#' + + level: 5