Details
-
Improvement
-
Resolution: Fixed
-
Medium
-
3.9.0
-
None
Description
Goal: slim eznewslettermail.php 800 lines down, looking to eradicate a few bugs there.
Hint: diff it with ezmail.php; exercise subclassing then.
Solution: see attachment.
How could such a monstrosity reach the official eZ publish repository: eznewslettermail is nothing but a copy-paste of ezmail!
Please note the solution I attach covers all modifications brought to eZNewsletterMail upon eZMail, except those to headerTextList, headerText and convertText, which did not seem specific to the newsletter and thus should be (if necessary) brought to eZMail instead of made specific to eZNewsletterMail: if they correct true bugs, these bugs probably appear in eZMail too.
Please note too, that I'm so depressed to see this that I didn't investigate to see if other files of eznewsletter (transport, smtptransport, and so on) had such a copy-paste origin. Similar refactoring should be done to avoid divergence of source code.
Steps to reproduce
- Try to understand why RFC822 headers do not get encoded, whereas you were used them to pass
- See that there is an entire eznewslettermail.php
- Compare it with ezmail.php
- Shout a desperate « Argh! »
- Look at what differs
- Make it subclass eZMail, remove redundant code
By the way, bug 011393 looks identical to what I experimented before merging classes, so it can probably be closed once it is done.