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

Correctly check if an error page can be duplicated #7095

Open
wants to merge 1 commit into
base: 5.3
Choose a base branch
from

Conversation

aschempp
Copy link
Member

@aschempp aschempp commented Apr 5, 2024

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.

@aschempp aschempp added the bug label Apr 5, 2024
@aschempp aschempp added this to the 5.3 milestone Apr 5, 2024
@aschempp aschempp requested a review from a team April 5, 2024 16:23
@aschempp aschempp self-assigned this Apr 5, 2024
@leofeyer
Copy link
Member

leofeyer commented Apr 9, 2024

Isn‘t the permission to copy a page independent of whether there is a root page to paste it?

@aschempp
Copy link
Member Author

we currently prevent to create multiple error_404 etc. pages inside the same root page, because only one should exist.

@leofeyer
Copy link
Member

leofeyer commented Apr 12, 2024

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.

@aschempp
Copy link
Member Author

The paste action is already prevented. But why would I copy if I cannot paste it anywhere?

@leofeyer
Copy link
Member

Currently, if you have an error_404 (or other error) page in a root page, you cannot duplicate it.

To prevent issues like this one. 😄

@aschempp
Copy link
Member Author

?? Thats what this PR fixes?

@leofeyer
Copy link
Member

You don‘t get the point. The copy operation should always be allowed, independent of hasPageTypeInRoot().

@aschempp
Copy link
Member Author

You don‘t get the point. The copy operation should always be allowed, independent of hasPageTypeInRoot().

why? Why would I copy a page if I cannot paste it?

@leofeyer
Copy link
Member

leofeyer commented Apr 16, 2024

Because these are two different operations that have nothing to do with each other.

  1. Copy.
  2. Paste.

Yes, that fails if a 404 page exists under every root page. But

  1. Copy.
  2. Delete an existing 404 page.
  3. Paste the duplicated page.

would not fail. However, your logic would prevent it for no reason.

@aschempp aschempp added the up for discussion Issues and PRs which will be discussed in our monthly Mumble calls. label Apr 30, 2024
@leofeyer leofeyer removed the up for discussion Issues and PRs which will be discussed in our monthly Mumble calls. label May 2, 2024
Copy link
Member

@leofeyer leofeyer left a 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.

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

Successfully merging this pull request may close these issues.

None yet

2 participants