-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
[NodeBundle] Undo deleting pages #2706
base: master
Are you sure you want to change the base?
Conversation
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.
Hi @, your PR needs some changes
- This PR seems to need a milestone of a minor release.
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.
Hi @, your PR passed all our requirements.
Thank you for contributing!
# Conflicts: # src/Kunstmaan/NodeBundle/Resources/translations/messages.en.yml
Hey @JZuidema. Thank you for your contribution. I have read your PR and tested in a local environment and i had a few things that might need looking at. The adminlist of deleted nodes does not seem to be limited to the current domain when having the multidomainbundle activated. I think this is quite important because otherwise it will become very confusing for which domains you are restoring pages, especially if they have identical titles. De button for restoring a page after it has been deleted should probably set that page in status Unpublished so that it doesn't immediately go live if it was published when it was deleted. Maybe a modal that shows a warning to the user on pressing the button might be helpful too. There was a small problem with buttons overlapping on my small laptop screen Thanks for taking a look at these things. |
@Numkil, thanks for replying! The adminlist of deleted nodes does not seem to be limited to the current domain when having the multidomainbundle activated. I think this is quite important because otherwise it will become very confusing for which domains you are restoring pages, especially if they have identical titles. De button for restoring a page after it has been deleted should probably set that page in status Unpublished so that it doesn't immediately go live if it was published when it was deleted. Maybe a modal that shows a warning to the user on pressing the button might be helpful too. There was a small problem with buttons overlapping on my small laptop screen |
@JZuidema I think i had made a mistake in the styling of my demo project. It is displayed correctly now. With the multidomain i meant this feature to manage multiple domains/websites with 1 cms. Because the pages are managed seperatly depending on which domain you are currently managing it would be confusing if the list for deleted nodes does not follow the same logic. |
Hi @Numkil I have never used the multi domain bundle, so I've added it into one of our projects. I'm not entirely sure how to fix the problem you're describing. From what i can see, nodes do not relate to a domain, even when this bundle is active, correct? |
When enabling the multidomain bundle you have to make a new Homepage for every domain. This can be achieved with the following code. |
@Numkil thanks for clarifying, it's clear now :). I'll change the code, hopefully somewhere next week. |
@Numkil actually I just realised it's quite an easy fix. Instead of overwriting the where's, I've parameterized the deleted value. |
Co-authored-by: Numkil <[email protected]>
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.
private function undoDeleteNode( | ||
Node $node | ||
) { | ||
$this->denyAccessUnlessGranted( |
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.
I would add a early return here if the node is not deleted. A possible case could be that you delete a parent with nested children and already restore a child before.
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.
I've applied this
…ture/undelete-nodes
# Conflicts: # src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php
@acrobat I've applied your feedback about being able to restoring deleted pages, and I've applied the early return if the node is not deleted. I'm not sure if your point about You mention |
This still needs some work as the overview adminlist of deleted pages should only show pages of the current rootNode. For single domain websites is does indeed show all deleted pages, but in a muiltidomain setup with separate rootNodes you should only see the deleted pages of the current rootNode/Domain. I'm removing the milestone so we finish this somewhere in 6.x |
Does anybody know what the current status/timeline for this PR is? |
Some of our clients have run into the issue a couple times now, where they accidentally remove a page. Either because they thought they were removing a different page, or because they pressed the wrong button when canceling their delete action.
When it happens, we have to manually update the database to set the page to not being deleted anymore, since it doesn't seem like you can do it in the CMS.
So, I've added a bit of code for it:
On the page overview screen, the screen you see when you've clicked on 'Pages' in the left top, there is an extra button now: "View deleted pages"
When you click on it, it'll show a list of pages you've deleted at one point. There is a button at the right top to navigate back to the pages view. The list doesn't show the deleted at date. It could be useful I guess, but the deleted at date is not being tracked right now, so it would have to be added.
The edit button will just send you to the edit view of the page, where as the undo button next to it will let you undo the deletion of the specific page.
If you choose to press edit on the page, you can also undo the deletion there