#102846Error with pidList in suggestOptions for group field in FlexForms
Description
When I add suggestOptions for a group field in a content flexform, the search returns no results.
The ajax request returns a warning:
PHP Warning: Undefined array key “” in vendor/typo3/cms-backend/Classes/Controller/Wizard/SuggestWizardController.php line 62
$parsedBody = $request->getParsedBody();is null so that the data will never be evaluated as flexform
if (empty($dataStructureIdentifier)) {
is always true.
Reviews 2
History 58
-
Stefan Terborg commented and changed subject
SuggestOptions for group field in FlexForms brokenError with pidList in suggestOptions for group field in FlexForms <span data-processor="relativetime" data-value="2024-01-18T06:42:54+00:00" > 01/18/24, 06:42 </span> -
Kai Strecker commented and changed Complexity no-brainer <span data-processor="relativetime" data-value="2024-05-06T10:42:57+00:00" > 05/06/24, 10:42 </span>
I have also just come across this bug.
As Stefan Terborg already pointed out, the cause is vendor/typo3/cms-backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php:115, which is this line of code:
$this->allowedPages = array_unique(array_merge($this->allowedPages, ...$availablePageIds));The bug here is that
$availablePageIdsis a one-dimensional array. Therefore, the use of...to pass the array values toarray_mergeis incorrect. The fix is to simply remove...:$this->allowedPages = array_unique(array_merge($this->allowedPages, $availablePageIds));After doing this patch, the suggest wizard worked fine in my TYPO3 instance.
-
Georg Ringer commented <span data-processor="relativetime" data-value="2024-06-11T20:36:25+00:00" > 06/11/24, 20:36 </span>
can be tested in styleguide in:
- flexforms: flex_1 > group_db_2
- tca: group_db_10
-
Gerrit Code Review pushed patch set 1 for main to change 84629 status
NewUnder Review <span data-processor="relativetime" data-value="2024-06-11T20:37:03+00:00" > 06/11/24, 20:37 </span> -
Gerrit Code Review pushed patch set 2 for main to change 84629 <span data-processor="relativetime" data-value="2024-07-15T12:10:45+00:00" > 07/15/24, 12:10 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 85202 <span data-processor="relativetime" data-value="2024-07-15T13:40:46+00:00" > 07/15/24, 13:40 </span>
-
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2024-07-15T13:45:08+00:00" > 07/15/24, 13:45 </span>Applied in changeset commit:660c8621b3ebe42cc4139e279253935c036b1a04.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2024-10-15T09:30:32+00:00" > 10/15/24, 09:30 </span>
I´m sorry, it seems I looked at the wrong place. ParsedBody is not null and the suggest options work.
Instead there seems to be a problem with <pidlist> causing the following error:</pidlist>
Example code:
... <suggestOptions> <default> <pidList>33,41</pidList> </default> </suggestOptions> ...Or maybe I’m missing some option for the usage with pidList.