Skip to content

Commit 7ddd4d3

Browse files
Merge branch 'feature/v2-update' of github.com:justbetter/magento2-akeneo-bundle into feature/v2-update
2 parents c8bfbd0 + 0b1bdd8 commit 7ddd4d3

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

.github/workflows/analyse.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,17 @@ jobs:
4949
run: composer analyse
5050

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

55-
strategy:
56-
fail-fast: false
57-
matrix:
58-
php-version: ['8.2', '8.3']
59-
6055
steps:
6156
- name: Checkout code
6257
uses: actions/checkout@v4
6358

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

@@ -76,8 +71,8 @@ jobs:
7671
uses: actions/cache@v4
7772
with:
7873
path: ${{ steps.composer-cache.outputs.dir }}
79-
key: ${{ runner.os }}-php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
80-
restore-keys: ${{ runner.os }}-php${{ matrix.php-version }}-composer-
74+
key: ${{ runner.os }}-php-composer-${{ hashFiles('**/composer.json') }}
75+
restore-keys: ${{ runner.os }}-php-composer-
8176

8277
- name: Install dependencies
8378
run: composer install --prefer-dist --no-progress --no-interaction

Job/RunSlackMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function getLogs(): Log\Collection
4343

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

4949
protected function getLogsByStatus(int $status): Log\Collection

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<a href="https://github.com/justbetter/magento2-akeneo-bundle" title="JustBetter Magento 2 Akeneo Bundle">
22
<img src="./.github/assets/banner.svg" alt="JustBetter Magento 2 Akeneo Bundle - Essential features the Akeneo Connector is missing">
33
</a>
4-
<h1>JustBeter - Magento 2 Akeneo Bundle</h1>
4+
<h1>JustBetter - Magento 2 Akeneo Bundle</h1>
55
<a id="readme-top"></a>
66

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

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

2323
<p align="center">
2424
Extends the official <a href="https://github.com/akeneo/magento2-connector-community">Akeneo Connector</a> with several features and optimizations.

Service/SetTaxClassId.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,15 @@ public function execute(string $code): void
6666
$connection = $this->entitiesHelper->getConnection();
6767

6868
foreach ($taxColumns as $taxIdColumn) {
69-
try {
70-
$taxQuery = $this->createQuery($taxIdColumn, $tmpTable);
71-
$connection->query($taxQuery);
72-
} catch (Exception $e) {
73-
throw $e;
74-
}
69+
$taxQuery = $this->createQuery($taxIdColumn, $tmpTable);
70+
$connection->query($taxQuery);
7571
}
7672
}
7773

7874
protected function createQuery(string $taxIdColumn, string $tableName): string
7975
{
80-
$query = "UPDATE `" . $tableName . "` SET `" . $taxIdColumn . "` = ";
76+
$connection = $this->entitiesHelper->getConnection();
77+
$query = "UPDATE " . $connection->quoteIdentifier($tableName) . " SET " . $connection->quoteIdentifier($taxIdColumn) . " = ";
8178

8279
return $this->addCase($query, $taxIdColumn);
8380
}
@@ -93,13 +90,14 @@ protected function addCase(string $query, string $taxIdColumn): string
9390
return $query;
9491
}
9592

93+
$connection = $this->entitiesHelper->getConnection();
9694
$query .= "CASE ";
9795

9896
foreach ($unserializedMappings as $mapping) {
9997
if (!is_array($mapping)) {
10098
continue;
10199
}
102-
$query .= "WHEN `" . $taxIdColumn . "` = '" . $mapping['akeneo'] . "' then '" . $mapping['magento'] . "' ";
100+
$query .= "WHEN " . $connection->quoteIdentifier($taxIdColumn) . " = " . $connection->quote($mapping['akeneo']) . " THEN " . $connection->quote($mapping['magento']) . " ";
103101
}
104102

105103
$query .= 'END';

0 commit comments

Comments
 (0)