xini / silverstripe-mailchimp-signup

Adds page type for a MailChimp signup form. Form fields are read automatically from the MailChimp list.
BSD 3-Clause "New" or "Revised" License
4 stars 6 forks source link

No-form state displays error message wrong #5

Closed WoodrowShigeru closed 5 years ago

WoodrowShigeru commented 5 years ago

If no API Key is provided yet, the template literally displays <p>Sorry, the signup form could not be loaded.</p> – unlocalized despite the i18n reference*, and as uninterpreted HTML with the <p> tags.

* <% _t('Innoweb\\MailChimpSignup\\Pages\\SignupPage.FORMNOTLOADED', 'Leider konnte das Anmeldeformular nicht geladen werden.') %>

I see two issues here:

(1) The template has an <% if $Form %>$Form<% else %>[…]<% end_if %> query. However, the else part is never reached, despite no-form.

(2) SignupPageController.php returns un-internationalized hard-coded English text in line 38. A return null; should suffice due to that very if query.

xini commented 5 years ago

Thanks for that. I have fixed this and also switched the error handling to use PHP's native error system to log errors.