diff --git a/src/Installer.php b/src/Installer.php index dd801c48..b514fe05 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -19,6 +19,7 @@ use Pimcore\Bundle\DataHubBundle\Controller\ConfigController; use Pimcore\Bundle\DataHubBundle\Migrations\PimcoreX\Version20210305134111; use Pimcore\Db; +use Pimcore\Extension\Bundle\Installer\Exception\InstallationException; use Pimcore\Extension\Bundle\Installer\SettingsStoreAwareInstaller; use Pimcore\Logger; use Pimcore\Model\Tool\SettingsStore; @@ -40,12 +41,12 @@ public function needsReloadAfterInstall(): bool */ public function install() { - // create backend permission - Definition::create(ConfigController::CONFIG_NAME)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save(); - Definition::create(self::DATAHUB_ADAPTER_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save(); - Definition::create(self::DATAHUB_ADMIN_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save(); - try { + // create backend permission + Definition::create(ConfigController::CONFIG_NAME)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save(); + Definition::create(self::DATAHUB_ADAPTER_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save(); + Definition::create(self::DATAHUB_ADMIN_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save(); + $types = ['document', 'asset', 'object']; $db = Db::get(); @@ -68,11 +69,10 @@ public function install() } } catch (\Exception $e) { Logger::warn($e); + throw new InstallationException($e->getMessage()); } parent::install(); - - return true; } /**