Skip to content

Commit 8dab2e1

Browse files
Myrmoddkd-kaehm
authored andcommitted
[BUGFIX] Add checks for flexParentDatabaseRow key in methods
This commit adds two checks for `flexParentDatabaseRow` keys to exist in the FlexFormUserFunctions class. The functionality is not being changed at all. Fixes: #4441
1 parent 96f5978 commit 8dab2e1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Classes/System/UserFunctions/FlexFormUserFunctions.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ class FlexFormUserFunctions
4242
*/
4343
public function getFacetFieldsFromSchema(array &$parentInformation): void
4444
{
45+
if (!array_key_exists('flexParentDatabaseRow', $parentInformation)) {
46+
$parentInformation['items'] = [];
47+
return;
48+
}
49+
4550
$pageRecord = $parentInformation['flexParentDatabaseRow'];
4651
// @todo: Fix type hinting issue properly on whole call chain.
4752
$configuredFacets = $this->getConfiguredFacetsForPage($pageRecord['pid'] ?? null);
@@ -139,6 +144,11 @@ protected function getFieldNamesFromSolrMetaDataForPage(array $pageRecord): arra
139144
*/
140145
public function getAvailableTemplates(array &$parentInformation): void
141146
{
147+
if (!array_key_exists('flexParentDatabaseRow', $parentInformation)) {
148+
$parentInformation['items'] = [];
149+
return;
150+
}
151+
142152
$pageRecord = $parentInformation['flexParentDatabaseRow'];
143153
if (!is_array($pageRecord) || !isset($pageRecord['pid'])) {
144154
$parentInformation['items'] = [];

0 commit comments

Comments
 (0)