Page MenuHomePhabricator

Fix a bug with creating Phortune merchant accounts without applying an email address transaction and some null field issues
ClosedPublic

Authored by epriestley on Nov 3 2016, 8:42 PM.

Details

Summary

When Phortune merchant accounts are created via mechanisms other than the web UI (for example, by Phacility unit tests) this validation check may fail.

Transactions are validated even if no transactions of the given type are being applied, to allow the editor to raise errors like "Name is required!".

If there's no TYPE_INVOICEEMAIL transaction, we'll get called with empty $xactions and fail on strlen($new_email) because the variable is never defined.

As a secondary issue, if contactInfo, invoiceEmail or invoiceFooter are not provided the record will fail to insert (none of these are nullable).

Test Plan

Ran Phacility unit tests, got a clean result for new instance creation.

Diff Detail

Repository
rP Phabricator
Branch
merchant1
Lint
Lint OK
Unit
Unit Tests OK
Build Status
Buildable 14345
Build 18676: Run Core Tests
Build 18675: arc lint + arc unit

Event Timeline

epriestley updated this revision to Diff 40455.Nov 3 2016, 8:42 PM
epriestley retitled this revision from to Fix a bug with creating Phortune merchant accounts without applying an email address transaction and some null field issues.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
epriestley added a child revision: Restricted Differential Revision.
chad accepted this revision.Nov 4 2016, 12:38 AM
chad edited edge metadata.
This revision is now accepted and ready to land.Nov 4 2016, 12:38 AM
chad added a comment.Nov 4 2016, 12:38 AM

thx, thought this all worked :/

This was pretty much impossible to catch and didn't actually break anything -- would only have been a problem when we wrote phortune.merchant.edit or something if the unit tests didn't get upset today. Actual instance creation and stuff would still have worked fine.

This revision was automatically updated to reflect the committed changes.