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

[BUGFIX + PATCH] Fix determination of flexform-data #43

Open
soda-2005 opened this issue Jul 11, 2023 · 6 comments
Open

[BUGFIX + PATCH] Fix determination of flexform-data #43

soda-2005 opened this issue Jul 11, 2023 · 6 comments

Comments

@soda-2005
Copy link

Without the patch "0001-BUGFIX-fix-determination-of-flexform-data.patch", the flexform-data can't be determinated, if we copy an gridelement (which contains a flexform) in TYPO3v11.
The patch 0001-BUGFIX-fix-determination-of-flexform-data.patch is a no-brainer - so, please use it :-)

How to reproduce the bug in TYPO3v11?

  1. Create an gridelement-record (on any TYPO3-page), which contains a flexform.
  2. Copy that gridelement-record
    Outcome: The copied gridelement-record has no data in his flexform. If the flexform contains images (wich are located in sys_file_reference-DB-table), than those images are now doubled in the original gridelement-record
@Bunnyfield
Copy link
Contributor

Bunnyfield commented Jul 11, 2023

Thanks for the report, but after looking at the patch I don't think this has something to do with the CMS 11 problems you described.

The part that gets changed by the patch will only be executed in CMS versions below 11 anway, so the patch should not change this at all. If this fixes your problems in CMS 11 this would be really weird, so the question is, if there was more than just that change in your patched TYPO3 project.

@soda-2005
Copy link
Author

soda-2005 commented Jul 11, 2023

Hi Bunnyfield,
Without this patch, the "complete logic to determine the flexform-config" will not be called/processed (so, as the result, the 'dummy' flexform-config 'FILE:EXT:gridelements/Configuration/FlexForms/default_flexform_configuration.xml' is used), because when you copy an gridelement, than the variable $row does NOT contain the uid - so $row['uid'] is NOT set.

The only thing, which this patch does is:
It does NOT check, if $row['uid'] exists - because $row['uid'] is NOT used inside the hook (in TYPO3v11).

@soda-2005
Copy link
Author

soda-2005 commented Jul 11, 2023

OK, sorry - i must change my statement:

  1. YES - the flexform-data will be copied (also, when the patch is NOT applied/used) - you have right at this point.
  2. When the patch is NOT applied/used, than images (which are defined in flexform via inline-formelement) will NOT correctly copied to the new/copied gridelement. The image will be 'stored/put' at the original gridelement (so the original gridelement will get 2 images instead of one - it will be doubled).

I used this flexform-config (to select an image inside an gridelement).

@Bunnyfield
Copy link
Contributor

My bad - the patch looked as if it was only concerning the part containing "fixVersioningPid", while it did not show the rest of the method.

Still the question is, why there is no 'uid' in CMS 11 in the first place, because usually there is either an integer or a placeholder starting with 'NEW' and AFAIK this did not change with CMS 11.

So maybe the problem is actually connected to that missing uid value and that again might be the reason for several FlexForm related problems that came up with CMS > 10

@soda-2005
Copy link
Author

Still the question is, why there is no 'uid' in CMS 11 in the first place
That's true - but: who cares? In TYPO3v11 we don't need the UID in the hook - so, we should not check, if the UID exists, when we don't use it ;-)

@Bunnyfield
Copy link
Contributor

So the solution would be to just move it to the second if clause, which is a bit less complicated than introducing another method.

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