Skip to content

Commit

Permalink
Fixed deprecation warnings being logged for TaxRate::$isVat
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Jan 31, 2025
1 parent daf41fd commit 2521e23
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft Commerce

## Unreleased

- Fixed a bug where the deprecated `TaxRate::$isVat` property was still being set. ([#3874](https://github.com/craftcms/commerce/issues/3874))

## 4.8.0 - 2025-01-30

### Store Management
Expand Down
4 changes: 2 additions & 2 deletions src/models/TaxRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ public function getIsEverywhere(): bool
*/
public function getIsVat(): bool
{
Craft::$app->getDeprecator()->log(__METHOD__, 'TaxRate::setIsVat() is deprecated.');

// Don't throw deprecation log as `isVat` is still set as an attribute so will be called when the model is serialized.
return $this->hasTaxIdValidators();
}

/**
* @param bool $isVat
* @throws DeprecationException
* @deprecated in 4.8.0.
*/
public function setIsVat(bool $isVat): void
Expand Down
1 change: 0 additions & 1 deletion src/services/TaxRates.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ private function _createTaxRatesQuery(): Query
'dateUpdated',
'id',
'include',
'isVat',
'name',
'rate',
'removeIncluded',
Expand Down

0 comments on commit 2521e23

Please sign in to comment.