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

(fix) #4408 Can't save discount codes #4410

Merged
merged 7 commits into from Jul 12, 2018

Conversation

4 participants
@ajporlante
Copy link
Contributor

commented Jul 9, 2018

Resolves #4408
Impact: major
Type: bugfix

Issue

Discount codes can't be saved because shopId is a required field but is not present in the document being submitted. I checked the method "discounts/addCode where shopId is being added to the document but it seems that SimpleSchema validation comes first before the document hits the said method causing the error.

Solution

Include shopId in the form.

Breaking changes

None.

Testing

  1. Go to Payments.
  2. Enable Codes and create a discount code.
  3. Save the discount code. There shouldn't be a validation error.
  4. Edit existing code. The changes made should persist.
@dancastellon

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2018

Confirmed this works!

@@ -21,7 +21,6 @@
resetOnSuccess=true
}}
<div>
{{> afQuickField name='code' placeholder="Discount Code"}}

This comment has been minimized.

Copy link
@zenweasel

zenweasel Jul 12, 2018

Member

Not sure of the ramifications but why did we remove this?

@zenweasel
Copy link
Member

left a comment

LGTM

@ajporlante

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2018

Really really nice catch there. It was not supposed to be removed so I put it back.

@spencern spencern merged commit 8abad85 into release-1.14.0 Jul 12, 2018

10 of 11 checks passed

License Compliance 6 issues found
Details
WIP ready for review
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: docker-build Your tests passed on CircleCI!
Details
ci/circleci: docker-push Your tests passed on CircleCI!
Details
ci/circleci: dockerfile-lint Your tests passed on CircleCI!
Details
ci/circleci: eslint Your tests passed on CircleCI!
Details
ci/circleci: snyk-security Your tests passed on CircleCI!
Details
ci/circleci: test-app Your tests passed on CircleCI!
Details
ci/circleci: test-unit Your tests passed on CircleCI!
Details
security/snyk - package.json No dependency changes
Details

@spencern spencern deleted the fix-4408-ajporlante-cant-save-discount-codes branch Jul 12, 2018

@spencern spencern referenced this pull request Jul 19, 2018

Merged

Release 1.14.0 #4338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.