Issue Bug New Orphaned

#91291FlexForm - Value of field is string instead of array

Markus Kugler 05/04/20, 14:46 updated 09/10/21, 14:33

Description

Hello everyone,

I’m currently working on a Extension with FlexForms and stumbled onto something.

Issue:
Accessing $config[‘row’][‘settings.*’] of other flexform settings in itemsProcFunc results in a string instead of an array while using a display condition in some cases.

Description:
I created a FlexForm with two selectSingleFields Board and List. Both fields get their values from itemsProcFunc. The List*-Select relies on a displayCond that requires *Board to be set. Board has an onChange reload property to reload the FlexForm that then shows List.
Code here:
https://github.com/Crontis/trello_integration/blob/master/Configuration/FlexForms/ShowCardsOnList.xml

In the List*-ItemsProcFunc I access the value of *Board. In some cases, like during the creation of a new content element with this plugin and flexform, the value of Board equals a string. In other cases, like editing an existing plugin, the value of Board equals an array with a single value.
Code here:
https://github.com/Crontis/trello_integration/blob/master/Classes/Backend/ItemsProcFunc.php

This seems to be an issue with the differentiation of columns into new or edit in FormDataProvider\TcaFlexProcess. In some occasions List will be an editColumn where Board is a newColumn. In this case Board will not be resolved at the time List is interpreted, which results in a string instead of an array.

I’m not too familiar with the handling of FlexForms but this does seem like a bug?

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] FlexForm - Value of field is string instead of array Resolves: #91291 Releases: main