@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D16798

+5 -1
+1
src/applications/phortune/editor/PhortuneMerchantEditor.php
··· 134 134 } 135 135 break; 136 136 case PhortuneMerchantTransaction::TYPE_INVOICEEMAIL: 137 + $new_email = null; 137 138 foreach ($xactions as $xaction) { 138 139 switch ($xaction->getTransactionType()) { 139 140 case PhortuneMerchantTransaction::TYPE_INVOICEEMAIL:
+4 -1
src/applications/phortune/storage/PhortuneMerchant.php
··· 19 19 public static function initializeNewMerchant(PhabricatorUser $actor) { 20 20 return id(new PhortuneMerchant()) 21 21 ->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy()) 22 - ->attachMemberPHIDs(array()); 22 + ->attachMemberPHIDs(array()) 23 + ->setContactInfo('') 24 + ->setInvoiceEmail('') 25 + ->setInvoiceFooter(''); 23 26 } 24 27 25 28 protected function getConfiguration() {