Skip to content

Commit

Permalink
Fixed #2842 zone condtion forumlas being cached incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Aug 5, 2022
1 parent 81e4b5a commit 2614d5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

### Fixed
- Fixed a bug where address zone condition formulas were being cached incorrectly. ([#2842](https://github.com/craftcms/commerce/issues/2842))
- Fixed a bug where querying for orders by email would return incorrect results on PostgreSQL.

## 3.4.15 - 2022-05-16
Expand Down
2 changes: 1 addition & 1 deletion src/services/Addresses.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public function addressWithinZone($address, AddressZoneInterface $zone): bool
$conditionFormula = $zone->getZipCodeConditionFormula();
$zipCode = $address->zipCode;

$cacheKey = get_class($zone) . ':' . $conditionFormula . ':' . $zipCode;
$cacheKey = get_class($zone) . ':' . md5($conditionFormula) . ':' . $zipCode;

if (Craft::$app->cache->exists($cacheKey)) {
$result = Craft::$app->cache->get($cacheKey);
Expand Down

0 comments on commit 2614d5d

Please sign in to comment.