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

Show error when deleting parent account #4809

Merged
merged 5 commits into from
Oct 14, 2019

Conversation

danrot
Copy link
Contributor

@danrot danrot commented Oct 11, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets ---
Related issues/PRs ---
License MIT
Documentation PR ---

What's in this PR?

This PR introduces an error message when an account which is the parent of another account is trying to be deleted.

Why?

Because we don't want to delete the child accounts when a parent account is deleted. What should happen instead is not completely clear, and this way the user can decide how to resolve this conflict.

And it is the same behavior as in Sulu 1.6.

To Do

  • Create a documentation PR
  • Add breaking changes to UPGRADE.md

@danrot
Copy link
Contributor Author

danrot commented Oct 11, 2019

IMO there is currently only one issue: When the error message is shown, deletion cannot be continued, but the dialog still shows two buttons: "Ok" and "Cancel". I think one of both should be gone, but I am not completely sure which one. @chirimoya Do you have any idea?


return $query->getResult();
} catch (NoResultException $ex) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i would expect an empty array in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, that's better 🙂 Done.


### DeleteToolbarAction with conflict

The `DeleteToolbarAction` asks for confirmation if e.g. a page that is being tried to deleted is linked on other pages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if being tried to deleted is correct. but dont have a better suggestion and i guess people will understand it anyway 🙂

@danrot danrot force-pushed the hotfix/parent-account-deletion branch from fc897d9 to 9edd378 Compare October 14, 2019 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants