Skip to content

Commit

Permalink
Merge branch '4.12' of https://github.com/craftcms/cms into 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Aug 26, 2024
2 parents 15f6228 + 3993ef1 commit 5894c49
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Added the `notRelatedTo` and `andNotRelatedTo` element query params. ([#15496](https://github.com/craftcms/cms/pull/15496))
- Added the `notRelatedTo` GraphQL element query argument. ([#15496](https://github.com/craftcms/cms/pull/15496))
- `relatedToAssets`, `relatedToCategories`, `relatedToEntries`, `relatedToTags`, and `relatedToUsers` GraphQL arguments now support passing `relatedViaField` and `relatedViaSite` keys to their criteria objects. ([#15508](https://github.com/craftcms/cms/pull/15508))
- Country field values and `craft\elements\Address::getCountry()` now return the country in the current application locale.

### Extensibility
- Added `craft\base\ApplicationTrait::getEnvId()`. ([#15313](https://github.com/craftcms/cms/issues/15313))
Expand Down
2 changes: 1 addition & 1 deletion src/elements/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public function getCountryCode(): string
*/
public function getCountry(): Country
{
return Craft::$app->getAddresses()->getCountryRepository()->get($this->countryCode);
return Craft::$app->getAddresses()->getCountryRepository()->get($this->countryCode, Craft::$app->language);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/fields/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function normalizeValue(mixed $value, ElementInterface $element = null):
}

try {
return Craft::$app->getAddresses()->getCountryRepository()->get($value);
return Craft::$app->getAddresses()->getCountryRepository()->get($value, Craft::$app->language);
} catch (UnknownCountryException) {
return null;
}
Expand Down

0 comments on commit 5894c49

Please sign in to comment.