FluidTYPO3 / flux

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

Flux removes needed TCEforms element from pi_flexform #1805

Closed jukkatawast closed 1 year ago

jukkatawast commented 4 years ago

Not sure if this is really a bug (and if it is, is it Flux bug?) but extension l10nmgr is not currently working with Flux based content elements. I think this is because TYPO3 Core expects the pi_flexform to contain TCEforms wrapper element and Flux apparently has removed that element in January with commit https://github.com/FluidTYPO3/flux/commit/0364023b089dd5308814d94d31c0146a74cb44f5

Issue in l10nmgr: https://gitlab.com/coderscare/l10nmgr/-/issues/30 Data structure example: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/DataFormats/T3datastructure/Elements/Index.html

And TYPO3 Core code which is apparently responsible for handling Flexform and where it still wants to have that TCEforms wrapper in place: https://github.com/TYPO3/TYPO3.CMS/blob/v10.4.4/typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php#L857

apiening commented 4 years ago

Since I'm also affected by the fact that the extension Localization Manager (https://extensions.typo3.org/extension/l10nmgr/) does not export Flux based content elements anymore, may I ask if there is a profound reason why the method patchTceformsWrapper was removed with https://github.com/FluidTYPO3/flux/commit/0364023b089dd5308814d94d31c0146a74cb44f5?

Since the export / import with the translation extension did work before, can the change be reverted in order to maintain compatibility?

NamelessCoder commented 4 years ago

The wrapper was removed since for quite some time, FormEngine has not required it to be present. This leaves just one place - the callback handling in FlexFormTools, which as far as I can tell is only used by third party code (which may explain why this code piece was never adjusted to also accept a DS without TCEforms wrappers, like FormEngine does).

While this is indeed an inconsistency, it is one that I would argue should be fixed by changing the checking line in FlexFormTools to also look for the config sub-array without a TCEforms wrapper, thus introducing consistency in the behavior of FormEngine and FlexFormTools. So I would recommend opening an issue on forge.typo3.org to ask for a patch that makes FlexFormTools behave like FormEngine does when checking the DS. As far as I can tell, this is the only place in the TYPO3 core that would need to be changed, then l10n_manager would work with DS arrays that don't use the wrapper.

I can only guess why FormEngine no longer requires it (but still supports it for legacy purposes), but it appears that the TCEforms wrapper has no real purpose - all it does is add an additional depth to DS arrays, so it would be easier and more compact to write DS arrays/XML if this wrapper could be left out. And it can be left out except for this usage in FlexFormTools which calls callback methods on third party objects.

Shentao83 commented 4 years ago

Hi there! I came here from this ticket on l10nmgr. https://gitlab.com/coderscare/l10nmgr/-/issues/30

Is it possible to somehow re-add the TCEforms wrapping? Since TYPO3 8 is not being updated anymore I am stuck not being able to translate some quite big websites with the L10Nmgr anymore.

And I don't know if downgrading to Flux 9.2 could be an option, since there were so many changes inbetween.

apiening commented 4 years ago

@Shentao83 My suggestion to re-add the TCEforms wrapping was rejected. But I did this manually for my local installation, and it worked for the export and import with L10nmgr. If you want to give it a try, you can simply re-add the lines that have been removed in https://github.com/FluidTYPO3/flux/commit/0364023b089dd5308814d94d31c0146a74cb44f5

I know this is far from being a good solution, but with this workaround it did at least work so I was able to finish a time sensitive project.

X-Tender commented 2 years ago

@apiening Is it save to still use this workaround or is there any other solution?

apiening commented 2 years ago

I'm not aware of any other solution, so I'm still using this workaround. In fact, this issue holds me back from upgrading a Typo3 instance running still on Typo3 9.5 because the customer depends on translation handling with L10Nmgr. At some point I might need to do a test setup with a Typo3 10 LTS installation to check whether this workaround still works.

X-Tender commented 2 years ago

I've just tested it with v10 and I was able to export and import tt_content with flexforms.

apiening commented 2 years ago

@X-Tender Do you mean with or without the code modifications / workaround?

X-Tender commented 2 years ago

With the workaround. I don't know which cases I have to test because I never worked with l10nmgr before and only did a quick test because our client asked for it. I've asked in the Slack channel about this solution, maybe I get a response ... But as far as I read the answer of NamelessCoder in this issue there are now plans to re-add it.

apiening commented 2 years ago

In 9.5 when this commit is not reverted content elements utilizing FlexForm are just not exported, while other CEs are.

At least it is good to know that the patch still works for the 10 LTS release. Thank you.

steampixel commented 2 years ago

@apiening This is not an optimal solution but saved my life :-) Seems to work with Typo3 10.4.23 THX!

TopSolid commented 2 months ago

With TYPO3 v12 and latest version of l10nmgr EA, flexforms are not supported anymore in Import/Export and this breaks again.