turnstile

Drupal paywall plugin
Log | Files | Refs | README | LICENSE

commit e16733232a9897c78072b4ed9b382bebdcfcbbbb
parent 0deb0181e490753bbec91e3c18bd8332dc7fe9d3
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 19 Oct 2025 16:51:21 +0200

minor fixes

Diffstat:
Msrc/Form/PriceCategoryForm.php | 2+-
Msrc/Form/SubscriptionPricesForm.php | 10+++++-----
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Form/PriceCategoryForm.php b/src/Form/PriceCategoryForm.php @@ -142,7 +142,7 @@ class PriceCategoryForm extends EntityForm { // Validate that the price is a valid non-negative number. if (!is_numeric($price) || $price < 0) { $form_state->setErrorByName( - "prices[$subscription_id][$currency_code]", + "prices][${subscription_id}][${currency_code}", $this->t('Prices cannot be negative.') ); } diff --git a/src/Form/SubscriptionPricesForm.php b/src/Form/SubscriptionPricesForm.php @@ -74,7 +74,7 @@ class SubscriptionPricesForm extends ConfigFormBase { '@url' => Url::fromRoute('turnstile.settings')->toString(), ]) ); - return $form; + return parent::buildForm($form, $form_state); } $form['description'] = [ @@ -88,12 +88,12 @@ class SubscriptionPricesForm extends ConfigFormBase { if (empty($currencies)) { $this->messenger()->addError($this->t('Unable to load currencies from the API. Please check your backend configuration.')); - return $form; + return parent::buildForm($form, $form_state); } if (empty($subscriptions)) { $this->messenger()->addWarning($this->t('No subscriptions configured in Taler merchant backend.')); - return $form; + return parent::buildForm($form, $form_state); } $form['subscription_prices'] = [ @@ -135,8 +135,8 @@ class SubscriptionPricesForm extends ConfigFormBase { '@currency' => $currency_code, ]), ]; - } - } + } // for all currencies + } // for all subscriptions return parent::buildForm($form, $form_state); }