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

Sending newsletter do not work #130

Open EurSylvain opened 5 years ago

EurSylvain commented 5 years ago

Hello,

I'm using SilverStripe 4.4.1. The backend Newsletter seems to work fine, until I actually try to send a newsletter.

I'm clicking on "Add Newsletter". Fill test as subject etc. I'm choosing the Basic Template. Then I save the Newsletter. Everything work as expected so far.

I'm choosing a MailingList, then click on "Send", and I obtain the following error :

[Emergency] Uncaught LogicException: GridField HTML fragment "buttons-before-right" was given content, but not defined. Perhaps there is a supporting GridField component you need to add?
GET /admin/newsletter/SilverStripe-Newsletter-Model-Newsletter/EditForm/field/SilverStripe-Newsletter-Model-Newsletter/item/18/edit?gridState=%7B%22GridFieldSortableHeader%22%3A%7B%22SortColumn%22%3A%5B%5D%7D%2C%22GridFieldFilterHeader%22%3A%7B%22Columns%22%3Anull%7D%2C%22GridFieldPaginator%22%3A%7B%22currentPage%22%3A1%2C%22itemsPerPage%22%3A15%7D%7D

Line 528 in /var/www/dev.estep.eu/vendor/silverstripe/framework/src/Forms/GridField/GridField.php

Cheers

micschk commented 4 years ago

Hi @EurSylvain dont know if this is still an issue but it could probably be resolved by adding a GridFieldButtonRow to the GridFieldConfig.

Eg. something like

$gridField->getConfig()->addComponent( new GridFieldButtonRow('before') );
EurSylvain commented 4 years ago

Dear @micschk ,

Thank you very much for your input. For the sake of testing I modified src/Model/Newsletter.php and added in line 285

$gridFieldConfig->addComponent( new GridFieldButtonRow('before') );

I also had to put use SilverStripe\Forms\GridField\GridFieldButtonRow; on top of the file. After this modification, the error message disappeared. Unfortunately, it's still not working. Now when I press the send button, no crash, but the "Sent to" tab contains nobody. I can see the chosen mailing list in the Main tab however.

Basically this module is broken in its current state with silverstripe 4.X and it needs some deep work to make it usable again (see my others opened issue). I unfortunately don't have time to do it myself for the moment, so I'm sticking to silverstripe 3.7.