FluidTYPO3 / flux

TYPO3 extension Flux: Dynamic Fluid FlexForms
https://fluidtypo3.org
146 stars 212 forks source link

Lost relation when exporting db #1766

Closed buepro closed 1 year ago

buepro commented 4 years ago

Environment

Error description

Related issues: #903

When creating the db-data for a distribution images used in flux elements are not exported. The flux element has the following configuration: Template, image sheet, image.

The preview from the tree to be exported reflects the loss from the relation to the image:

fluxcard

For a gridelements element it looks as following:

gridelementscard

Findings

It looks like the impexp-plugin can't detect the relation to the image due to missing configuration in $GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds']. When adding the following configuration the impexp plugin detects the relation:

$GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds']['*,fluxelements_card'] = 'FILE:EXT:flux_elements/Configuration/FlexForms/Card.xml';

Corrections

NamelessCoder commented 4 years ago

Could the flexform be configured in a separate file or are there any compatibility issues or drawbacks with it?

Only that it wouldn't be dynamic and isn't defined in the template which uses it. Should work the same in all other ways.

Could the entries to $GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds'] be generated by flux?

Yes, but only safely so, in cases where the static option for the Flux form is set to true - if the DS isn't static it is implied dynamic and couldn't be generated universally for all instances of the CType.

However, if impexp doesn't detect the references that might indicate another problem - there is an API for resolving the DS which should trigger Flux if used, but if impexp doesn't use this API and only looks for the ds TCA option that would explain the problem. If this is the case it would be a core bug.

buepro commented 4 years ago

Thank you very much for the answer. Since the form has some dynamic elements the ststic option can't be used. It looks like the external (in a separate file) and the local configuration are merged. This works for the given use case.

NamelessCoder commented 1 year ago

This issue should be fixed now, since re-introducing the "TCEforms" wrapper element in the resolved DS. Nearly all places in TYPO3 did correctly support a DS without this wrapper (in fact, it is removed by the FormEngine...) but some places - like impexp or the suggest wizard receiver - were not capable of handling a DS without it.