-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Prevent delete/disable CMS pages used in configuration #4239
Conversation
Isn't it better to put it in the controller? Resource should not do these checks |
There are different checks in resource, e.g. Having it in model allows to use ... |
Maybe a unit test for the helper method, but this can be done in another PR. |
I am testing this PR. For the 404 Not Found page (no-route).
Another observation changing the URL Key will have a negative impact. For example, from no-route to no-route-2. |
Having two messages is intended. The page gets saved, but resets "is active" option to yes. I have not tested changing url-key ... what happens? (I am not at home to test it) |
Good idea. I think there are other scenarios to cover ...
|
Better leave it for another PR. |
@sreichel - I agree. What else I would propose for this PR would be a different message, for example You cannot delete or disable the page nor change the URL Key as long as it is used as a Default Page in the configuration. One message covers all the situations and makes the things clear. Like a general warning what you cannot do. |
This will not work. There is a difference between them. When deleting an exception is thrown (red message) and the "delete action" is aborted. When disabling the "save action" continues, all other changes are applied, but active state is set back and a warning (yellow message) is left. |
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.
Tested
Reproduce
Try to disable/delete configured
no-route
page.Related Pull Requests