silverstripe-gridfield-betterbuttons
silverstripe-gridfield-betterbuttons copied to clipboard
Causes bug when used with newsletter module
trafficstars
I'm not sure which module is strictly to blame, but the newsletter module relies on a button called "action_doSave" that is apparently not available when adding a newsletter when this module is installed.
To replicate, install this module and https://github.com/silverstripe-labs/silverstripe-newsletter and try to add a new newsletter.
The error thrown is:
Fatal error: Call to a member function setTitle() on a non-object in /Users/naomiguyer/Sites/privacy/newsletter/code/form/gridfield/NewsletterGridFieldDetailForm.php on line 19
Which relates to this code:
if (empty($this->record->Status) || $this->record->Status == "Draft") {
// save draft button
$actions->fieldByName("action_doSave")
->setTitle(_t('Newsletter.SAVE', "Save"))
->removeExtraClass('ss-ui-action-constructive')
->setAttribute('data-icon', 'addpage');
Editing newsletters appears to work fine.