Skip to content

Commit 80121cd

Browse files
committed
[FIX] Error with save resource.
1 parent 53dce27 commit 80121cd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Controllers/sLangController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ public function prepareFields(array $content): array
7171
}
7272
}
7373

74-
$translates = sLangContent::whereResource($content['id'] ?? 0)->get()->toArray();
74+
$translates = sLangContent::withoutGlobalScope('language')
75+
->whereResource($content['id'] ?? 0)
76+
->get()
77+
->toArray();
7578

7679
if (is_array($translates) && count($translates)) {
7780
foreach ($translates as $translate) {

src/sLang.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ public function isMultilangTv($id): bool
222222
*/
223223
public function getLangContent(int $resourceId, string $langKey): array
224224
{
225-
$sLangContent = sLangContent::whereResource($resourceId)->whereLang($langKey)->first();
225+
$sLangContent = sLangContent::withoutGlobalScope('language')
226+
->whereResource($resourceId)
227+
->whereLang($langKey)
228+
->first();
226229
return $sLangContent ? $sLangContent->toArray() : [];
227230
}
228231

0 commit comments

Comments
 (0)