Aaron Cooper

I have a dataobject with two tabs (in the CMS) and I’ve added some custom buttons down by the Save/Delete buttons by adding an extension to SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest and using the updateFormActions method.

Works fine. But I only want the custom buttons to display when one of the tabs is loaded. Anyone know if that’s even possible?

nightjarnz

I don't see why it woudln't be possible, so long as there's a page request between it showing and not-showing. Otherwise the state change will be hard to manage.

Aaron Cooper

That’s just it, I don’t think there is a page request when switching tabs in the CMS

Aaron Cooper

I also don’t know if there is a method inside of Silverstripe that allows you know what tab is active from the serverside

xyphoid

like i now have new getGridField but all the current getEditForm code still works

xyphoid

just reading 4.6's changelog, am i correct in reading this ModelAdmin::getEditForm() change to be backwards compatible

jkersu

I mean if you call Email::mailer() , does it return MailgunMailer or the base Mailer class? 🙂

Batsis

@jkersu it not using the micschk/silverstripe-mailgun-mailer always falling back to sendmail

jkersu

@Batsis Is it even using the correct mailer? Whats the result of Email::mailer() ?

Batsis

@Nick I have added Injector::inst()->registerService(new MailgunMailer(), 'Mailer'); but not if (Director::isLive()) { Injector::inst()->registerService(new MailgunMailer(), 'Mailer');

  1. }