Patch (to be ported)
Project:
Emogrifier
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2012 at 19:12 UTC
Updated:
2 Feb 2015 at 23:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jamsilver commentedThis patch should certainly _just work_ for those trying to get this to work with HTMLMail.
Comment #2
roball commentedTotally agreed. This also solves the critical bug #1336106: Emogrifier removes styles instead of embedding them!. I will post a patch for the D6 version later today.
Comment #3
roball commentedAttached is the patch against the 6.x-1.x branch. I can confirm this fixes #1336106: Emogrifier removes styles instead of embedding them!, in addition to many other potential problems, since most of the module's code has been removed. I have changed the target version of this issue to 6.x-1.x-dev since I have successfully tested it on the D6 version.
The D7 patch posted by jamsilver above needs work to additionally remove dead unneeded code.
Comment #4
roball commentedPatch attached again with its file name renamed, since the name in #3 above made problems in downloading through the browser.
Comment #5
bennybobw commented@roball You should open separate issue to backport along with a link this so that people know there's a patch for 7.x on this thread.
Comment #6
roball commentedOK, but the 7.x-1.x-dev patch from #1 needs work, as mentioned in #3.
Comment #7
dkelly60 commentedI tried patching with this and get
Hunk #1 FAILED at 82.
1 out of 1 hunk FAILED
Comment #8
duaelfrPatch rerolled against lastest 7.x-1.x-dev
Comment #9
duaelfrThe previous patch was based on the #4 one
Comment #10
aidanlis commentedPatch #8 works ... without it half the content disappeared from my email. What the hell was the original module author thinking?
Comment #11
roball commentedComment #12
deggertsen commentedBeautiful! Thanks for the patch @DuaelFr.
Comment #13
abudev commentedPatch applied and no inline styles applied.
PHP Document Object Model extension is available.
Module Libraries enabled.
Library emogrifier.php in sites/all/libraries/emogrifier
Is there something more?
restored the module and commented line 158 work for me but it's not the point
Comment #14
thsutton commentedThe patch in #8 works great for me applied against 7.x-1.18.
Comment #15
john franklin commentedPatch in #4 works great for 6.x-1.18.
Comment #16
aquariumtap commentedI wouldn't recommend committing this yet. Currently any style definitions need to be within the text that is being filtered. That's not particularly handy.
Emogrifier is only passed the text that's being filtered. emogrifier.module, line 82:
That second parameter should contain the contents of any stylesheets used in the theme. At least that was my expectation after trying this module, but it's not documented where the styling should be.
Comment #17
thsutton commentedWhy should it apply theme style sheets? There's no reason to expect theme stylesheets -- written to style whole pages, with lots of divs, classes and IDs -- will apply sensibly to filtered text.
The best use case for this module is in concert with modules like HTML Mail where it can be used to process whole emails *after* they've been themed and have their stylesheets.
I'd change it back to RTBC but find that a little rude when other people do it. :-)
Comment #18
aquariumtap commentedThere's no module documentation about which stylesheets are used to convert classes to inline styles. That's really the core issue. I'll make a separate one for that.
This patch did work for me!
Comment #19
ollynevard commentedPatch in #8 worked for me against 7.x-1.18.
Comment #20
deggertsen commentedCan't wait for this to be committed. Frustrating to install this module on different sites only to have it work after realizing this patch hasn't been committed yet.
Comment #21
roball commentedIn contrast to the Maintenance status that has been selected on this module's project page ("Actively maintained"), this module is obviously NOT maintained anymore. I don't suspect the maintainer will still care about it, so I wouldn't expect to see any commits unless a new maintainer takes over it.
Comment #22
marcus178 commentedThe latest 7.x-1.x-dev patch doesn't work for those with this issue
https://drupal.org/node/2195043
it needs to be
$emogrifier = new \Pelago\Emogrifier($text, '');not
$emogrifier = new Emogrifier($text, '');Comment #23
geek-merlinThanks @markus178 to link the issue #2195043: Install Issue - Not compatible with latest Emogrifier Library.
This one is already rtbc, so i re-rolled the patch in the other issue to apply onto this one.
Comment #24
haggins commentedThanks for the patch, it fixed the stripping issue.
Comment #25
ndf commentedComment #27
john franklin commented