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
F14316423: D16798.id40455.diff
Wed, Dec 18, 7:13 AM
F14306699: D16798.id.diff
Tue, Dec 17, 10:39 PM
Unknown Object (File)
Fri, Dec 13, 8:15 PM
Unknown Object (File)
Sat, Nov 23, 5:08 AM
Unknown Object (File)
Tue, Nov 19, 12:08 PM
Unknown Object (File)
Oct 20 2024, 9:19 AM
Unknown Object (File)
Oct 19 2024, 1:08 PM
Unknown Object (File)
Oct 16 2024, 9:21 AM
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.