Review main Abandoned

60803[TASK] Make initializeMailer() protected

Sascha Ternes CR 0 V 0 Easy +4 −2 updated 06/13/19, 07:43

Commit message

I want to make use of the Swift_Mailer plugin feature. Therefore I want to
extend the MailMessage class and prepare the Mailer in function
initializeMailer().

Changing this method from private to protected makes it possible to just
overwrite it in subclasses, without the need to overwrite the whole send()
method.

I wanted to keep the change small. We could call initializeMailer() in the
constructor. We could also introduce a getter for the mailer object. That
may be something for a FEATURE.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 1216

  1. Sascha Ternes uploaded patch set 1 05/23/19, 12:19

  2. Dennis Grün voted on patch set 1 V +1 CR +1 05/23/19, 12:24

  3. Sascha Ternes updated the commit message in patch set 2 05/23/19, 12:25

  4. TYPO3com voted on patch set 1 V +1 05/23/19, 12:34 Completed build in 14m 47s on Thu, 23 May, 02:34 PM Test Summary: 46389 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33981

  5. Dennis Grün voted on patch set 2 CR +1 05/23/19, 12:37

  6. TYPO3com voted on patch set 2 V +1 05/23/19, 12:38 Completed build in 12m 54s on Thu, 23 May, 02:38 PM Test Summary: 46389 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33982

  7. Andreas Kienast commented on patch set 2 CR -1 05/23/19, 13:28

    Wouldn't it be better to change the code to call `$this->initializeMailer()` in the constructor? This way you're able use `$this->mailer`. I can't evaluate any negative implication, though. Please also note that you propose a [FEATURE]. Those are for master only and usually won't get backported to 9.5 and 8.7, especially since the latter is in priority bugfix mode. Also, features require a documentation file in ReST format. I think, if it breaks nothing, it's fine to make it a [TASK] for master and 9.5 instead.
  8. Sascha Ternes updated the commit message in patch set 3 05/23/19, 13:50

  9. Mathias Brodala updated the commit message in patch set 4 05/23/19, 13:55

  10. Mathias Brodala commented on patch set 4 CR -1 05/23/19, 13:56

  11. Sascha Ternes commented on patch set 4 CR +1 05/23/19, 14:02

    > Patch Set 4: Code-Review-1 > > Are you aware of https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.1/Feature-62960-SignalForMailerInitialization.html ? No, I wasn't. Seems to be sufficient for the purpose. But why is this change such a big thing to you?
  12. TYPO3com voted on patch set 3 V +1 05/23/19, 14:05 Completed build in 14m 40s on Thu, 23 May, 04:05 PM Test Summary: 46388 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33983

  13. TYPO3com voted on patch set 4 V +1 05/23/19, 14:08 Completed build in 12m 57s on Thu, 23 May, 04:08 PM Test Summary: 46389 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33984

  14. Mathias Brodala commented on patch set 4 05/23/19, 14:16

    > Patch Set 4: Code-Review+1 > > > Patch Set 4: Code-Review-1 > > > > Are you aware of https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.1/Feature-62960-SignalForMailerInitialization.html ? > > No, I wasn't. Seems to be sufficient for the purpose. But why is this change such a big thing to you? Every change which increases the public API should be discussed since it adds a maintenance burden and a full 2-release cycle in case of a deprecation and removal. Also you should not vote on your own change. ;-)
  15. Sascha Ternes commented on patch set 4 05/23/19, 14:25

    > Every change which increases the public API should be discussed since it adds a maintenance burden and a full 2-release cycle in case of a deprecation and removal. I agree, it should be discussed. I do not consider it a significant increase. One could always extend the public __construct() or public send() (as I have done for my purposes). So a protected initialize() is nothing more problematic. > Also you should not vote on your own change. ;-) I agree, too. My +1 was a vote on your hint with the signal ;-)
  16. Sascha Ternes abandoned the change 06/13/19, 07:43

    I will use the Mailer::postInitializeMailer signal to hook in.