-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Correctly check if an error page can be duplicated #7095
base: 5.3
Are you sure you want to change the base?
Conversation
Isn‘t the permission to copy a page independent of whether there is a root page to paste it? |
we currently prevent to create multiple error_404 etc. pages inside the same root page, because only one should exist. |
I know. But I should still be able to copy it even if there is no option to paste it. The paste action is what we should prevent, not the copy action. |
The paste action is already prevented. But why would I copy if I cannot paste it anywhere? |
To prevent issues like this one. 😄 |
?? Thats what this PR fixes? |
You don‘t get the point. The copy operation should always be allowed, independent of |
why? Why would I copy a page if I cannot paste it? |
Because these are two different operations that have nothing to do with each other.
Yes, that fails if a 404 page exists under every root page. But
would not fail. However, your logic would prevent it for no reason. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in the Contao call, the copy action and the paste action should be independent from each other if "copy" means "put on clipboard". If the "copy" action duplicates the record directly (e.g. in the list view), copying and pasting should be seen as one operation.
Currently, if you have an error_404 (or other error) page in a root page, you cannot duplicate it. That's because the voter checks if such a page already exists in the current root. We need to allow copying if any other root page does not have that type.