Merge pull request #6728 from papnoisanjeev/category-slug-local-based

category slug update for requested locale #6725
This commit is contained in:
Jitendra Singh 2022-09-19 17:00:28 +05:30 committed by GitHub
commit 8fa224bb9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -284,11 +284,13 @@ class CategoryRepository extends Repository
foreach ($attributeNames as $attributeName) {
foreach (core()->getAllLocales() as $locale) {
foreach ($model->translatedAttributes as $attribute) {
if ($attribute === $attributeName) {
$data[$locale->code][$attribute] = isset($data[$requestedLocale][$attribute])
? $data[$requestedLocale][$attribute]
: $data[$data['locale']][$attribute];
if ($requestedLocale == $locale->code) {
foreach ($model->translatedAttributes as $attribute) {
if ($attribute === $attributeName) {
$data[$locale->code][$attribute] = isset($data[$requestedLocale][$attribute])
? $data[$requestedLocale][$attribute]
: $data[$data['locale']][$attribute];
}
}
}
}