-
-
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
[BUG] Check action type for fixed promotion #13393
[BUG] Check action type for fixed promotion #13393
Conversation
SirDomin
commented
Dec 14, 2021
Q | A |
---|---|
Branch? | master |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | |
Related tickets | |
License | MIT |
be91dff
to
1102193
Compare
1102193
to
8c25381
Compare
features/promotion/managing_catalog_promotions/validating_catalog_promotion_creation.feature
Outdated
Show resolved
Hide resolved
if ($data['type'] === CatalogPromotionActionInterface::TYPE_FIXED_DISCOUNT) { | ||
foreach ($data['configuration'] as $channelConfiguration) { | ||
if ($channelConfiguration['amount'] === '') { | ||
return; | ||
} | ||
} | ||
} |
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.
Should we be so hardcoded to one action type?
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.
thats only place where this error occurs, so i had to handle only when channelConfiguration is available.
$form = $event->getForm(); | ||
|
||
$actionConfigurationType = $this->actionConfigurationTypes[$data->getType()]; | ||
$form->add('configuration', $actionConfigurationType, [ |
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.
Why is it needed to be added on submit?
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.
without adding it to sumit form resets and we dont have inputs for selected action type
src/Sylius/Bundle/CoreBundle/Resources/translations/validators.en.yml
Outdated
Show resolved
Hide resolved
The base of this pull-request was changed, you need fetch and reset your local branch Unless you added new commits (to this branch) locally that you did not push yet, Feel free to ask for assistance when you get stuck 👍 |
8c25381
to
f739862
Compare
f739862
to
bd5f34b
Compare
bd5f34b
to
aa029f5
Compare
src/Sylius/Bundle/CoreBundle/Resources/translations/validators.en.yml
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/CoreBundle/Resources/translations/validators.en.yml
Outdated
Show resolved
Hide resolved
Thank you, @SirDomin! 🎉 |