Skip to content

Commit

Permalink
[Core] Resolve installation failing
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinMitchell committed Feb 21, 2024
1 parent 5497847 commit 312e4b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions modules/btcpay/btcpay.php
Original file line number Diff line number Diff line change
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 312e4b0

Please sign in to comment.