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

Copy&Paste of container element with children #74

Open
z-gingco opened this issue Nov 11, 2020 · 12 comments
Open

Copy&Paste of container element with children #74

z-gingco opened this issue Nov 11, 2020 · 12 comments
Labels

Comments

@z-gingco
Copy link

Our template has a number of container elements built with flux. The container elements are allowed inside the backend layout columns (e.g CType = xyz_sectioncontainer,xyz_teasercontainer) whereas basic elements like text, textpic, etc. are not allowed to be inserted directly into the content column. It works perfectly, except for the case when an editor tries to copy/paste a container to a new location. In this case only the container itself gets copied and for each of the children elements an error message "record couldn't be saved due to disallowed value(s)" appears.
image
An interesting observation - when the copied container is inserted before the original container, all works well; when after the original container the errors described above occur.
Thanks for looking into this and for your great work!

@IchHabRecht
Copy link
Owner

Hi @z-gingco,

Thank you for submitting the issue. Unfortunately I'm unable to reproduce your issue. Maybe this is related to the flux extension you are using. If you have further information, please submit a pull request. Maybe the flux extension needs some adjustments to be compatible to content_defender and needs to use one or more signals provided by the extension.

@rafu1987
Copy link

I have a similar error, using b13/container, when setting "allowed" in a container to a certain other container element which has children. The error message "couldn't be saved due to disallowed value(s)" fires for every content element inside the allowed container element, when i.e. moving this element to the outer container element. After reloading the backend, everything is, as it should be, but the error message is wrong here, because I am moving an allowed container element, so the children should not throw this error.

Do you think this could also a problem with b13/container and I should report the error there?

@IchHabRecht
Copy link
Owner

Hi @rafu1987,

Thank you for your report. I found this ticket in the container repository b13/container#84 dealing with copy & paste of container elements. Can you check if you are using the most current version of both extensions and maybe raise a new ticket in the container repository with all needed information to be able to reproduce the problem?

@rafu1987
Copy link

Hi @IchHabRecht,

I think the error was due to different container elements, having same colPos values. I gave every container a unique colPos and the error is now gone, so I think that was it for me. Thanks for the feedback and your great work on content_defender! :-)

@IchHabRecht
Copy link
Owner

Hi @z-gingco,

I comparison to the EXT:container extension, I guess the inline elements of your flux container elements are using any colPos defined in the backend_layout with some content_defender restrictions set?! So the flux extension needs to provide a valid (or none) configuration for inline elements to content_defender to be able to correctly copy & paste them.

@npoggenburg
Copy link

npoggenburg commented Dec 7, 2020

Hi,
i can confirm the problem on a fresh TYPO3 10 with Container Extension and FluidStyledContent Elements.
Bildschirmfoto 2020-12-07 um 16 29 35
We have multiple container elements with a similar setup. Its not possible to copy & paste this content element:
Column: Header restrictions: header, text
Column: 1, Column 2 restrictions: header, textmedia
Bildschirmfoto 2020-12-07 um 16 30 02

using the newest version of content-defender and container extension.

If i can help somehow to make this a reproducible, give me an @ :D

@opi99
Copy link

opi99 commented Dec 18, 2020

There was a bugfix in b13/container, which helps to reduce this issue b13/container/#112

@z-gingco
Copy link
Author

z-gingco commented Mar 17, 2021

Hello @IchHabRecht, first of all thanks a lot for looking into this issue. We have investigated further and noticed that in our setup, the functionality has been broken since the update of Flux from 9.3.2 to 9.4. After rolling back the following commit - FluidTYPO3/flux@42d16f0 - everything works. Do you have any idea why this would break things? Should I give you an example of our flux form? Thanks again

@IchHabRecht
Copy link
Owner

Hi @z-gingco,

Thank you for providing further information. Unfortunately I do not use the EXT:flux by myself, so I'm not able to give any kind of support. Maybe the extension developer can give further information about the compatibility between both extension or is able to provide proper fixes for a new release.

@z-gingco
Copy link
Author

@IchHabRecht thanks for your answer, I opened an issue in the flux repo FluidTYPO3/flux#1876.

@kitzberger
Copy link

kitzberger commented Aug 3, 2021

@IchHabRecht, having the same (?) situation for container elements created with mask/mask_export. On top I use my own EXT:dragon_drop to be able to move CEs within, to and from colPos 999.

Scenario:

  • The mask CType is called container and allows textmedia and textpic as child elements within its colPos 999.
  • The page's backend_layout defines two "content defended" columns:
    • colPos 0 that allows those CTypes: textmedia and container.
    • colPos 1 that allows only CTypes: textpic.

✔️ Moving a textmedia CE from colPos 0 to colPos 999 works fine.
🔴 Moving a textpic CE from colPos 1 to colPos 999 (within colPos 0) is blocked but should be working

Probably I'd have to hook into content_defender to make its isRecordAllowedByRestriction() allow the container's allowed CTypes as well?

@IchHabRecht
Copy link
Owner

Hi all,

This issue should be fixed with #117 as IRRE content elements are now ignored from content_defender processing.

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

No branches or pull requests

6 participants