-
Notifications
You must be signed in to change notification settings - Fork 40
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] Fix paste handling in CmdMap part #77
Conversation
We now support negative uids on the target while handling paste commands. Resolves: IchHabRecht#76
Hi @opi99, The handling of a negative page id is handeled already in the DatamapDataHandlerHook, where it's belonging as you copy/paste an content element. Does the mentioned issue also happen with any core element and FAL references or does it apply to container elements only? |
It's a content element build with mask, so no b13/container_element ... will check with Text-Image from core |
Now, tried it with the "image" element with one image, now the source record have 2 references to same image. |
In the issue I added to the description, that this shouldn't be the first position on page. |
I was wondering why this is broken as there are tests to cover the copy & paste handling. I found out that the datamap changed from TYPO3 version 7.6 (where content_defender comes from) to TYPO3 8.7. I adjusted the tests and the handling. Would you mind to test the branch https://github.com/IchHabRecht/content_defender/tree/fix-copy-paste and see if this fixes your problem/problems. |
This leads to allowing all content to be added on target also the wrong ones ... but this sounds a bit stupid, as you didn't changed anything else. Need to check again and look deeper. |
As tests are running, I would think there needs to be some other problem. Have you enabled content_defender at all? |
So digging deeper ... more or less your patch does the same as mine for calculating. So without b13/container it should work. And here we come to the point, that this can't work. The function getConfigurationByColPos calls the $hookObject->manipulateConfiguration which uses the given $recordUid to find the parent but this will be the parent of the source and not the parent of the target. And that the source location worked is known couse the source resides there. This function only gets a target $colPos but knows nothing about the $targetElement. If the given $recordUid is (from my patch) 'NEW_' it gives the configuration back as is, which works on my system with my test but should also fail on other combinations like insert into another element and not on plain page. So, all in all, it seams the handling is wrong on both sides content_defender and b13/container so maybe it needs patches on both sides of the API to get this resolved. Maybe we could write/call in slack to look forward. Edit: Maybe the source UID is needed to know what will be tried to insert but IMHO it shouldn't be needed to calculate the configuration array. But maybe another tool which likes to hook into could get the possibility to do so. |
To be honest, I don't fully understand your explanation. Inside the call So from content_defenders point of view the paste of a content element on another page like described in your ticket should be fixed. |
You have a hook inside your API
And here
|
This is intended and because there is not need for content_defender to build the configurationIdentifier depending on the record uid. |
Yes, no need for content_defender but maybe for extensions which use the hook. |
Fixed with #78 |
We now support negative uids on the target while handling paste
commands.
Resolves: #76