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.
Tags
None
Referenced Files
F12849797: D16798.diff
Fri, Mar 29, 4:53 AM
F12842945: D16798.id40455.diff
Thu, Mar 28, 10:24 PM
F12837274: D16798.id.diff
Thu, Mar 28, 4:49 PM
F12837222: D16798.id40459.diff
Thu, Mar 28, 4:44 PM
F12834025: D16798.id40459.diff
Thu, Mar 28, 2:22 PM
F12833485: D16798.id40455.diff
Thu, Mar 28, 2:05 PM
Unknown Object (File)
Sat, Mar 23, 6:02 PM
Unknown Object (File)
Tue, Mar 19, 8:29 PM
Subscribers
None

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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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 edited edge metadata.
This revision is now accepted and ready to land.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.