diff --git a/Classes/Form/Container/Grid.php b/Classes/Form/Container/Grid.php index 450830d5d..88d3ef6b7 100644 --- a/Classes/Form/Container/Grid.php +++ b/Classes/Form/Container/Grid.php @@ -142,7 +142,7 @@ public function buildExtendedBackendLayoutArray(int $parentRecordUid): array * @param int $parentRecordUid * @return BackendLayout */ - public function buildBackendLayout(int $parentRecordUid): BackendLayout + public function buildBackendLayout(int $parentRecordUid): ?BackendLayout { $configuration = $this->buildBackendLayoutArray($parentRecordUid); $configuration = $this->ensureDottedKeys($configuration); @@ -153,9 +153,12 @@ public function buildBackendLayout(int $parentRecordUid): BackendLayout foreach ($this->flattenSetup($configuration, 'backend_layout.') as $name => $value) { $typoScriptString .= $name . ' = ' . $value . LF; } + if ($root->getName() === null) { + return null; + } return new BackendLayout( $this->getRoot()->getName(), - LocalizationUtility::translate($label) + LocalizationUtility::translate($label, $root->getExtensionName()) ? $label : 'LLL:EXT:flux/Resources/Private/Language/locallang.xlf:flux.grid.grids.grid', $typoScriptString diff --git a/Classes/Provider/AbstractProvider.php b/Classes/Provider/AbstractProvider.php index 8d42aa421..691524a4c 100644 --- a/Classes/Provider/AbstractProvider.php +++ b/Classes/Provider/AbstractProvider.php @@ -342,11 +342,15 @@ public function getGrid(array $row) $gridColumn->setColSpan($object['colspan'] ?? 1); } } + $grid->setParent($form); return $grid; } } $grid = $this->grid ?? $this->extractConfiguration($row, 'grids')['grid'] ?? Grid::create(); $grid->setExtensionName($grid->getExtensionName() ?: $this->getControllerExtensionKeyFromRecord($row)); + if ($form) { + $grid->setParent($form); + } return $grid; }