Skip to content

Commit

Permalink
[Bug]: Fix grid batch edit not considering the current language( #413)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Feb 7, 2024
1 parent 24660b6 commit 85fff0e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Controller/Admin/DataObject/DataObjectHelperController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,15 @@ public function batchAction(Request $request): JsonResponse
$object = DataObject\Concrete::getById($params['job']);

if ($object) {
$requestedLanguage = $params['language'];
if ($requestedLanguage) {
if ($requestedLanguage != 'default') {
$request->setLocale($requestedLanguage);
}
} else {
$requestedLanguage = $request->getLocale();
}

$name = $params['name'];

if (!$object->isAllowed('save') || ($name === 'published' && !$object->isAllowed('publish'))) {
Expand All @@ -1554,15 +1563,6 @@ public function batchAction(Request $request): JsonResponse
$keyId = $parts[3];

if ($type == 'classificationstore') {
$requestedLanguage = $params['language'];
if ($requestedLanguage) {
if ($requestedLanguage != 'default') {
$request->setLocale($requestedLanguage);
}
} else {
$requestedLanguage = $request->getLocale();
}

$groupKeyId = explode('-', $keyId);
$groupId = (int) $groupKeyId[0];
$keyId = (int) $groupKeyId[1];
Expand Down

0 comments on commit 85fff0e

Please sign in to comment.