-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Addressing] Prevent deleting zones and provinces that are zone members #14041
[Addressing] Prevent deleting zones and provinces that are zone members #14041
Conversation
409d8b8
to
cc2f3d6
Compare
607c45e
to
610832e
Compare
{ | ||
Assert::contains( | ||
$this->responseChecker->getError($this->client->getLastResponse()), | ||
'Cannot delete, the province is in use.' |
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.
This error message and Error Cannot delete, the province is in use.
src/Sylius/Behat/Context/Ui/Admin/ManagingCountriesContext.php:284 shouldn't be more likely the same?
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.
features/addressing/managing_countries/managing_provinces_of_country.feature
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Resources/config/services/checkers.xml
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/EventListener/ZoneMemberIntegrityListener.php
Show resolved
Hide resolved
features/addressing/managing_countries/managing_provinces_of_country.feature
Show resolved
Hide resolved
610832e
to
199f7d5
Compare
…at are zone members
…ing zones and provinces
199f7d5
to
1e650c9
Compare
Thank you, Kevin! 🥇 |
This PR was merged into the 1.11 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.11 | | Bug fix? | yes | | New feature? | no | | BC breaks? | no | | Deprecations? | no | | Related tickets | #14041 | | License | MIT | Without orphan removal, even if we delete the zone member, the corresponding province/country cannot be removed because orphans still exist in the database. Commits ------- 47fef6e [Addressing] Enable orphan removal for zone members
This PR was merged into the 1.11 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.11 | | Bug fix? | yes (for Symfony 6) | | New feature? | no | | BC breaks? | not yet | | Deprecations? | no | | Related tickets | partially #13274 related #14041 | | License | MIT | <!-- - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- 46cbdef Fix zone member integrity listener 138b136 Keep session for now 561867a Fix Psalm errors 9ab8098 Trying to fix Phpspec on Symfony 4.4 af47339 Fix Phpspec errors again 9ade6f2 Apply suggestions from code review c165241 Use request stack service everytimes
It is possible to delete the resource (zone or province) that is already in use as a zone member. When we delete such a resource, we cannot access the zone edit screen (and probably even more) because we try to load an unexisting resource 💥
Sample error: