Skip to content

Commit c734c8d

Browse files
committed
[BUGFIX] Ignore restriction for single type records
(cherry picked from commit 95ce803)
1 parent 7ef4c20 commit c734c8d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Classes/Form/FormDataProvider/AllowedRecordTypesInSite.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
2121
use TYPO3\CMS\ContentBlocks\SiteSet\ContentBlockSiteRegistry;
22+
use TYPO3\CMS\Core\Schema\Exception\InvalidSchemaTypeException;
2223
use TYPO3\CMS\Core\Schema\TcaSchemaFactory;
2324
use TYPO3\CMS\Core\Site\Entity\Site;
2425

@@ -36,8 +37,8 @@ public function __construct(
3637
public function addData(array $result): array
3738
{
3839
$tableName = $result['tableName'];
39-
$contentElementSchema = $this->tcaSchemaFactory->get($tableName);
40-
if ($tableName !== $contentElementSchema->getName()) {
40+
$schema = $this->tcaSchemaFactory->get($tableName);
41+
if ($tableName !== $schema->getName()) {
4142
return $result;
4243
}
4344
$site = $result['site'];
@@ -49,7 +50,11 @@ public function addData(array $result): array
4950
if ($contentBlocks === []) {
5051
return $result;
5152
}
52-
$typeField = $contentElementSchema->getSubSchemaTypeInformation()->getFieldName();
53+
try {
54+
$typeField = $schema->getSubSchemaTypeInformation()->getFieldName();
55+
} catch (InvalidSchemaTypeException) {
56+
return $result;
57+
}
5358
$items = $result['processedTca']['columns'][$typeField]['config']['items'] ?? [];
5459
if ($items === []) {
5560
return $result;

0 commit comments

Comments
 (0)