jkersu

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

jkersu

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

jkersu

@Ben No, I dont think it does. I typically just have the following code in my projects to add a global template variable $IsDev:

  1. namespace yournamespace;
  2.  
  3. use SilverStripe\View\TemplateGlobalProvider;
  4. use SilverStripe\Control\Director;
  5.  
  6. class GlobalTemplateProvider implements TemplateGlobalProvider
  7. {
  8. /**
  9.   * Provides a global $IsDev variable to be used in templates
  10.   *
  11.   * @return array
  12.   */
  13. public static function get_template_global_variables()
  14. {
  15. return [
  16. 'IsDev' => 'isDev',
  17. ];
  18. }
  19.  
  20. /**
  21.   * Checks whether we're in dev mode or not.
  22.   *
  23.   * @return boolean
  24.   */
  25. public static function isDev()
  26. {
  27. return Director::isDev();
  28. }
  29. }
jkersu

@Jeroen Pielage it has been removed in ss4. Try FormAction::create()->setAttribute('type', 'reset') instead

jkersu

My hunch that its working for tests because the test is using Admin permission

jkersu

Mmm... I would’ve thought something like Versioned::get_by_stage(File::class, Versioned::DRAFT)->byID(1); would work 🙄

jkersu

What happens if you specify the stage mode? @wmk