Skip to content

Commit

Permalink
Merge pull request #9 from customgento/support-2.4.4
Browse files Browse the repository at this point in the history
Add support for 2.4.4
  • Loading branch information
BorisovskiP authored May 4, 2022
2 parents 415da2a + e16f9b7 commit aefd274
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 18 deletions.
46 changes: 34 additions & 12 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,58 +23,80 @@ jobs:
options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.3.7-p1 (PHP 7.3)
- name: M2 Integration Tests with Magento 2 Version 2.3.7-p2 (PHP 7.3)
uses: extdn/github-actions-m2/magento-integration-tests/7.3@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.3.7-p1'
ce_version: '2.3.7-p2'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.3.7-p1 (PHP 7.4)
- name: M2 Integration Tests with Magento 2 Version 2.3.7-p2 (PHP 7.4)
uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.3.7-p1'
ce_version: '2.3.7-p2'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.3.7-p2 (PHP 7.3)
- name: M2 Integration Tests with Magento 2 Version 2.3.7-p3 (PHP 7.3)
uses: extdn/github-actions-m2/magento-integration-tests/7.3@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.3.7-p2'
ce_version: '2.3.7-p3'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.3.7-p2 (PHP 7.4)
- name: M2 Integration Tests with Magento 2 Version 2.3.7-p3 (PHP 7.4)
uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.3.7-p2'
ce_version: '2.3.7-p3'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.4.3 (PHP 7.3)
- name: M2 Integration Tests with Magento 2 Version 2.4.3 (PHP 7.3)
uses: extdn/github-actions-m2/magento-integration-tests/7.3@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.4.3'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.4.3 (PHP 7.4)
- name: M2 Integration Tests with Magento 2 Version 2.4.3 (PHP 7.4)
uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.4.3'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.4.3-p1 (PHP 7.3)
- name: M2 Integration Tests with Magento 2 Version 2.4.3-p1 (PHP 7.3)
uses: extdn/github-actions-m2/magento-integration-tests/7.3@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.4.3-p1'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.4.3-p1 (PHP 7.4)
- name: M2 Integration Tests with Magento 2 Version 2.4.3-p1 (PHP 7.4)
uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.4.3-p1'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.4.3-p2 (PHP 7.4)
uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.4.3-p2'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.4.4 (PHP 7.4)
uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.4.4'
- uses: actions/checkout@v2
- name: M2 Integration Tests with Magento 2 Version 2.4.4 (PHP 8.1)
uses: extdn/github-actions-m2/magento-integration-tests/8.1@master
with:
module_name: CustomGento_CliTaxEditor
composer_name: customgento/module-cli-tax-editor-m2
ce_version: '2.4.4'
composer_version: '2'
9 changes: 4 additions & 5 deletions Console/Command/Tax/Rates/EditCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,12 @@ private function updateTitlesForTaxRate(TaxRateInterface $taxRate, int $newRate)
{
// assumption: everyone writes the tax rate without decimal places in their code / title
// current shortcut: only integer tax rates are supported - this will not work for decimal tax rates
$oldRate = (int)$taxRate->getRate();
$newCode = str_replace($oldRate, $newRate, $taxRate->getCode());
$oldRate = (string)$taxRate->getRate();
$newCode = str_replace($oldRate, (string)$newRate, $taxRate->getCode());
$taxRate->setCode($newCode);

$titles = $taxRate->getTitles();
foreach ($titles as $title) {
$newValue = str_replace($oldRate, $newRate, $title->getValue());
foreach ($taxRate->getTitles() as $title) {
$newValue = str_replace($oldRate, (string)$newRate, $title->getValue());
$title->setValue($newValue);
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"require": {
"magento/framework": "~102.0||~103.0",
"magento/module-tax": "~100.3",
"php": "~7.3.0||~7.4.0",
"php": "~7.3.0||~7.4.0||~8.1.0",
"symfony/console": "~4.1"
},
"require-dev": {
Expand Down

0 comments on commit aefd274

Please sign in to comment.