@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.

When a Phortune subscription has a removed payment method, be more explicit about it

Summary:
Currently, when a payment method is invalid we still render the full name and let you save the form without making changes. This can be confusing.

Instead:

- Render "<Deleted Payment Method>", literally.
- Render an error immediately.
- Prevent the form from being saved without changing the method.

Test Plan: {F1955487}

Reviewers: chad

Reviewed By: chad

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

+15 -9
+15 -9
src/applications/phortune/controller/PhortuneSubscriptionEditController.php
··· 50 50 51 51 $current_phid = $subscription->getDefaultPaymentMethodPHID(); 52 52 53 + $e_method = null; 54 + if ($current_phid && empty($valid_methods[$current_phid])) { 55 + $e_method = pht('Needs Update'); 56 + } 57 + 53 58 $errors = array(); 54 59 if ($request->isFormPost()) { 55 60 ··· 57 62 if (!$default_method_phid) { 58 63 $default_method_phid = null; 59 64 $e_method = null; 60 - } else if ($default_method_phid == $current_phid) { 61 - // If you have an invalid setting already, it's OK to retain it. 62 - $e_method = null; 63 - } else { 64 - if (empty($valid_methods[$default_method_phid])) { 65 - $e_method = pht('Invalid'); 65 + } else if (empty($valid_methods[$default_method_phid])) { 66 + $e_method = pht('Invalid'); 67 + if ($default_method_phid == $current_phid) { 68 + $errors[] = pht( 69 + 'This subscription is configured to autopay with a payment method '. 70 + 'that has been deleted. Choose a valid payment method or disable '. 71 + 'autopay.'); 72 + } else { 66 73 $errors[] = pht('You must select a valid default payment method.'); 67 74 } 68 75 } ··· 86 93 87 94 // Don't require the user to make a valid selection if the current method 88 95 // has become invalid. 89 - // TODO: This should probably have a note about why this is bogus. 90 96 if ($current_phid && empty($valid_methods[$current_phid])) { 91 - $handles = $this->loadViewerHandles(array($current_phid)); 92 97 $current_options = array( 93 - $current_phid => $handles[$current_phid]->getName(), 98 + $current_phid => pht('<Deleted Payment Method>'), 94 99 ); 95 100 } else { 96 101 $current_options = array(); ··· 129 134 ->setName('defaultPaymentMethodPHID') 130 135 ->setLabel(pht('Autopay With')) 131 136 ->setValue($current_phid) 137 + ->setError($e_method) 132 138 ->setOptions($options)) 133 139 ->appendChild( 134 140 id(new AphrontFormMarkupControl())