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

Add main controller #824

Merged
merged 3 commits into from
Dec 19, 2023
Merged

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Dec 16, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
License MIT

Extracted from #817

@loic425 loic425 requested a review from a team as a code owner December 16, 2023 09:15
Comment on lines +49 to +52
$valid = $request->attributes->getBoolean('is_valid', true);
if (!$valid) {
$operation = $operation->withWrite(false);
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$valid = $request->attributes->getBoolean('is_valid', true);
if (!$valid) {
$operation = $operation->withWrite(false);
}
$operation = $operation->withWrite($request->attributes->getBoolean('is_valid', true));

But I wonder if is_valid should not be false by default

Copy link
Member Author

Choose a reason for hiding this comment

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

If we configure "validate: false" on an operation, we don't have this attribute on request.

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not agree with your suggestion, the developer could configure Create(write: false), validation is ok, and then it will write and developer does not want that.

Copy link
Member

@diimpp diimpp left a comment

Choose a reason for hiding this comment

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

Left few comments on previous PR #817 (review)

@lchrusciel lchrusciel merged commit ef19751 into Sylius:1.11 Dec 19, 2023
24 checks passed
@lchrusciel
Copy link
Member

Thank you, @loic425!

@loic425 loic425 deleted the feature/main-controller branch December 19, 2023 13:30
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.

None yet

3 participants