Skip to content

Commit

Permalink
[Core] Resolve installation failure (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinMitchell authored Feb 21, 2024
1 parent 5497847 commit daac5df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
10 changes: 3 additions & 7 deletions modules/btcpay/btcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct()
{
$this->name = 'btcpay';
$this->tab = 'payments_gateways';
$this->version = '6.1.0';
$this->version = '6.1.1';
$this->author = 'BTCPay Server';
$this->ps_versions_compliancy = ['min' => Constants::MINIMUM_PS_VERSION, 'max' => _PS_VERSION_];
$this->controllers = ['payment', 'validation', 'webhook'];
Expand Down Expand Up @@ -117,12 +117,8 @@ public function install(): bool
return false;
}

if (null === ($repository = $this->get('prestashop.module.btcpay.repository.install')) || false === $repository instanceof TableRepository) {
$this->addModuleErrors(['Expected a TableRepository repository, but received null/something else']);

return false;
}

// Create required tables
$repository = new TableRepository($this->get('doctrine.dbal.default_connection'));
if (!empty($errors = (new Tables($repository))->install())) {
$this->addModuleErrors($errors);
$this->uninstall();
Expand Down
9 changes: 2 additions & 7 deletions modules/btcpay/src/Repository/TableRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@ class TableRepository
*/
private $connection;

/**
* @var string
*/
private $prefix;

public function __construct(Connection $connection, string $prefix)
public function __construct(Connection $connection)
{
$this->connection = $connection;
$this->prefix = $prefix;
$this->prefix = \_DB_PREFIX_;
}

/**
Expand Down

0 comments on commit daac5df

Please sign in to comment.