Skip to content

Commit f866002

Browse files
committed
Bugfix: Refactor getPropertyGroup method to improve locale handling for PropertyGroupCollection and PropertyDataGroupDto
1 parent 36f35ec commit f866002

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/Base/Dtos/Concerns/HasPropertyGroup.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ public function getPropertyGroup(string $key)
2525
}
2626

2727
$result = $this->propertyData->get($key, null);
28-
if ($result && $result instanceof PropertyGroupCollection) {
29-
$result->setFallbackLocale($this->getFallbackLocale());
28+
29+
if ($result) {
30+
31+
$locale = $this->getLocale() ?? $this->getFallbackLocale();
32+
33+
if ($result instanceof PropertyGroupCollection
34+
|| $result instanceof PropertyDataGroupDto
35+
) {
36+
$result = $result->setFallbackLocale($locale);
37+
}
3038
}
3139

3240
return $result;

0 commit comments

Comments
 (0)