From 2521e2395045f53f2992b806f6b11d6962789d42 Mon Sep 17 00:00:00 2001 From: Nathaniel Hammond Date: Fri, 31 Jan 2025 18:42:27 +0000 Subject: [PATCH] Fixed deprecation warnings being logged for `TaxRate::$isVat` --- CHANGELOG.md | 4 ++++ src/models/TaxRate.php | 4 ++-- src/services/TaxRates.php | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index faa5b03a1d..75ad0f3c89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/models/TaxRate.php b/src/models/TaxRate.php index 9d986b8496..666b7452a8 100644 --- a/src/models/TaxRate.php +++ b/src/models/TaxRate.php @@ -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 diff --git a/src/services/TaxRates.php b/src/services/TaxRates.php index 6acbf93a5a..4ce0a88282 100644 --- a/src/services/TaxRates.php +++ b/src/services/TaxRates.php @@ -226,7 +226,6 @@ private function _createTaxRatesQuery(): Query 'dateUpdated', 'id', 'include', - 'isVat', 'name', 'rate', 'removeIncluded',