Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,17 @@ jobs:
run: composer analyse

phpcs:
name: Code Style (PHP ${{ matrix.php-version }})
name: Code Style
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
php-version: '8.2'
extensions: bcmath, ctype, curl, dom, gd, hash, iconv, intl, mbstring, openssl, pdo_mysql, simplexml, soap, xsl, zip
coverage: none

Expand All @@ -76,8 +71,8 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php${{ matrix.php-version }}-composer-
key: ${{ runner.os }}-php-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
Expand Down
2 changes: 1 addition & 1 deletion Job/RunSlackMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function getLogs(): Log\Collection

return $this->logCollection
->addFieldToFilter('created_at', ['gteq' => date('Y-m-d')])
->addFieldToFilter('created_at', ['lt' => date('Y-m-d', $tomorrow !== false ? $tomorrow : time() + 86400)]);
->addFieldToFilter('created_at', ['lt' => date('Y-m-d', $tomorrow !== false ? $tomorrow : strtotime('tomorrow'))]);
}

protected function getLogsByStatus(int $status): Log\Collection
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a href="https://github.com/justbetter/magento2-akeneo-bundle" title="JustBetter Magento 2 Akeneo Bundle">
<img src="./.github/assets/banner.svg" alt="JustBetter Magento 2 Akeneo Bundle - Essential features the Akeneo Connector is missing">
</a>
<h1>JustBeter - Magento 2 Akeneo Bundle</h1>
<h1>JustBetter - Magento 2 Akeneo Bundle</h1>
<a id="readme-top"></a>

[![Latest Version on Packagist][packagist-version-shield]][packagist-version-url]
Expand All @@ -18,7 +18,7 @@
<img src="https://raw.githubusercontent.com/justbetter/art/master/justbetter-logo.png" alt="JustBetter Logo" width="200">
</a>

<h3 align="center">JustBeter - Magento 2 Akeneo Bundle</h3>
<h3 align="center">JustBetter - Magento 2 Akeneo Bundle</h3>

<p align="center">
Extends the official <a href="https://github.com/akeneo/magento2-connector-community">Akeneo Connector</a> with several features and optimizations.
Expand Down
14 changes: 6 additions & 8 deletions Service/SetTaxClassId.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,15 @@ public function execute(string $code): void
$connection = $this->entitiesHelper->getConnection();

foreach ($taxColumns as $taxIdColumn) {
try {
$taxQuery = $this->createQuery($taxIdColumn, $tmpTable);
$connection->query($taxQuery);
} catch (Exception $e) {
throw $e;
}
$taxQuery = $this->createQuery($taxIdColumn, $tmpTable);
$connection->query($taxQuery);
}
}

protected function createQuery(string $taxIdColumn, string $tableName): string
{
$query = "UPDATE `" . $tableName . "` SET `" . $taxIdColumn . "` = ";
$connection = $this->entitiesHelper->getConnection();
$query = "UPDATE " . $connection->quoteIdentifier($tableName) . " SET " . $connection->quoteIdentifier($taxIdColumn) . " = ";

return $this->addCase($query, $taxIdColumn);
}
Expand All @@ -93,13 +90,14 @@ protected function addCase(string $query, string $taxIdColumn): string
return $query;
}

$connection = $this->entitiesHelper->getConnection();
$query .= "CASE ";

foreach ($unserializedMappings as $mapping) {
if (!is_array($mapping)) {
continue;
}
$query .= "WHEN `" . $taxIdColumn . "` = '" . $mapping['akeneo'] . "' then '" . $mapping['magento'] . "' ";
$query .= "WHEN " . $connection->quoteIdentifier($taxIdColumn) . " = " . $connection->quote($mapping['akeneo']) . " THEN " . $connection->quote($mapping['magento']) . " ";
}

$query .= 'END';
Expand Down