Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous FlexForm properties generic.redirect vs. generic.redirect.pid #152

Open
ohader opened this issue Nov 24, 2022 · 4 comments
Open

Comments

@ohader
Copy link
Contributor

ohader commented Nov 24, 2022

When previewing content, \TYPO3\CMS\Core\Service\FlexFormService::convertFlexFormContentToArray is used to create a hierarchical representation of FlexForm values. Properties containing a dot . are organized in this structure. For instance property values a.b=1, a.c=2 are converted to an array like ['a' => ['b' => 1, 'c' => 2]].

Using ambiguous names in different hierarchy levels leads to problems when processing the FlexForm data. In this particular case properties generic.redirect and generic.redirect.pid cannot be represented in mentioned structure. The corresponding error message in the TYPo3 backend looks like the following.

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Cannot create references to/from string offsets | Error thrown in file /var/www/html/www/typo3/sysext/core/Classes/Service/FlexFormService.php in line 54. (TYPO3 v10)

Screen Shot 2022-11-24 at 22 06 35

(side note: TYPO3 core uses a `try/catch` block when invoking `FlexFormService`, the screenshot above is triggered by `ext:solr` which does not apply `try/catch` - anyway, the problem is caused by `ext:mkforms`)

I'd suggest to rename FlexForm property generic.redirect to generic.redirect.enable in https://github.com/DMKEBUSINESSGMBH/typo3-mkforms/blob/v10.1.3/flexform_main.xml#L100-L108

@hannesbochmann
Copy link
Member

hannesbochmann commented Nov 25, 2022

@ohader Thanks for the report. We are aware of this problem but just haven't got time to deal with it as we need to keep backwards compatibility. So it's not just this simple change. Furthermore there are similar problems with EXT:mksearch and it's Flexform when some extbase domain model/repository is used somewhere in the plugin. The root cause is EXT:rn_base and it's internal configuration parsing which we leveraged in the past and is now in conflict with the core.
We will have a look at it.

hannesbochmann added a commit that referenced this issue Jan 6, 2023
@hannesbochmann
Copy link
Member

@ohader Could you please check if the problem still persists with the latest version of the 11.5 branch?

@ohader
Copy link
Contributor Author

ohader commented Jan 10, 2023

The mentioned problem occurred in a project using TYPO3 v10, ext:mkforms was added as dependency by https://packagist.org/packages/oliverklee/seminars#v4.4.0. Newer versions of ext:seminars dropped the requirement to ext:mkforms - which I did in mentioned project. Thus, unfortunately, I don't have a test scenario anymore.

@ohader
Copy link
Contributor Author

ohader commented Jan 10, 2023

However, commit 78899e7 looks good to me as it gets rid of mentioned ambiguity in the names of the FlexForm structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants