silverstripe-archive / silverstripe-newsletter

NewsletterAdmin is the CMS class for managing the newsletter system.
BSD 3-Clause "New" or "Revised" License
69 stars 59 forks source link

Newsletter formular subscription error #129

Open EurSylvain opened 5 years ago

EurSylvain commented 5 years ago

Hi, I'm using Silverstripe 4.4.1. In the following examples, I've moved the registration newsletter formular to /library/registration/, but it's still using the default "Newsletter Subscription Page" page type.

When submitting the newsletter registration formular, there's some errors :

[Emergency] Uncaught Error: Class 'SilverStripe\Newsletter\Form\SubscriptionPage' not found
POST /library/registration/Form/

Line 81 in /var/www/(..)/vendor/silverstripe/newsletter/src/Form/SubscriptionForm.php

Fine, it lacks a use on top. I had a "use SilverStripe\Newsletter\PageTypes\SubscriptionPage;" in this code, and then resubmit again. Then :

[Emergency] Uncaught Error: Class 'SilverStripe\Newsletter\Form\ArrayList' not found
POST /library/registration/Form/

Line 91 in /var/www/(..)/vendor/silverstripe/newsletter/src/Form/SubscriptionForm.php

Ok another use error. I'm adding use SilverStripe\ORM\ArrayList; on top of the file and resubmit :

[Emergency] Uncaught Error: Call to a member function FieldList() on null
POST /library/registration/Form/

Line 117 in /var/www/(..)/vendor/silverstripe/newsletter/src/Form/SubscriptionForm.php

For reference, line 117 is $recipientInfoSection = $form->Fields()->fieldByName('MemberInfoSection')->FieldList();

Cheers