From: Marcel Werk Date: Fri, 2 Jan 2015 23:10:21 +0000 (+0100) Subject: Fixed issue in paid subscription forms X-Git-Tag: 2.1.0_Beta_3~48 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dedb61806b58ed143d9225498e52c1c4a8c3bb46;p=GitHub%2FWoltLab%2FWCF.git Fixed issue in paid subscription forms --- diff --git a/wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php index fafff93293..953268cb70 100644 --- a/wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php @@ -6,6 +6,7 @@ use wcf\data\paid\subscription\PaidSubscriptionEditor; use wcf\data\paid\subscription\PaidSubscriptionList; use wcf\data\user\group\UserGroup; use wcf\form\AbstractForm; +use wcf\system\exception\NamedUserException; use wcf\system\exception\UserInputException; use wcf\system\language\I18nHandler; use wcf\system\payment\method\PaymentMethodHandler; @@ -145,6 +146,10 @@ class PaidSubscriptionAddForm extends AbstractForm { // get available user groups $this->availableUserGroups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS)); + if (!count(PaymentMethodHandler::getInstance()->getPaymentMethods())) { + throw new NamedUserException(WCF::getLanguage()->get('wcf.acp.paidSubscription.error.noPaymentMethods')); + } + // get available currencies foreach (PaymentMethodHandler::getInstance()->getPaymentMethods() as $paymentMethod) { $this->availableCurrencies = array_merge($this->availableCurrencies, $paymentMethod->getSupportedCurrencies()); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 9ae24431a7..e88385e0f9 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1220,6 +1220,7 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> title|language}“ für den Benutzer „{$subscriptionUser->username}“ wirklich entfernen?]]> + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 35882df7b5..f2c9b4402d 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1219,6 +1219,7 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> title|language}” for the user “{$subscriptionUser->username}”?]]> +