Hi,
I'm trying this out and have run into a problem that I'm pretty sure can be reduced to the emogrifier.php file or maybe the emogrifier directory.
If I have the emogrifier.php file or any php file in the sites/all/modules/enews/emogrifier then all parts of the module basically stop printing to the screen and it seems like the VR components get broken too. I know adding the node will work, but on submit I'm returned a white screen.
With the php file present in the emogrifier directory all the "Campaign tabs" show this status message:
"This status of this email campaign is . Therefore, changes made to this content will not be passed to VerticalResponse."
With the file present clicking on the "Theme Newsletter" tab results in a blank page at /node/enews-export/theme
If I remove the file I can publish a newsletter node and everything will work and then if I add the emogrifier.php file back in it will again stop working.
I believe even if I have a file named something similar, i.e. emogrifier1.php, the module still breaks.
The directory emogrifier permissions are 755 and the emogrifier.php file has been tried with both 644 and 755 and there's no difference.
I haven't found any errors in my apache log to explain any of this so I thought I'd ask for help here.
Thanks for any help or suggestions,
David
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 929056-emogrifier-debug.patch | 1003 bytes | jbomb |
Comments
Comment #1
jbomb commentedThanks for the report David. Have you tried removing the "@" symbol from the beginning of lines 280 and 281 in enews.module? This may help provide some insight into the issue that you are experiencing.
Comment #2
biscuit.tech commentedI put the emogrifier.php file back into place and removed the '@' symbol from these two lines (on my file it's 272,273)
Unfortunately the result is the same, blankness.
Comment #3
jbomb commentedThe VerticalResponse error that you're receiving on the campaign pages occurs when the campaign id in the database does not match a campaign in VerticalResponse. Sometimes this occurs when the VerticalResponse API is not available at the time that the campaign is created, but it can also happen if the campaign is removed from VerticalResponse, or if the VR API is unavailable when you are viewing the campaign content on Drupal. This is a separate issue that needs to be addressed in the VR module.
The emogriphier issue is puzzling. I don't suppose there are any useful errors in Drupal's watchdog logs that might give you some indication of what is awry?
Would you mind describing how your style sheets are included for the content type? Are you including style sheets from the theme, the path to locally hosted css, or are you typing the CSS into the provided text field? If you are providing a path to a local css file or typing the text into the textfield is there a wysiwyg editor wrapping your path or styles in paragraph tags?
Comment #4
biscuit.tech commentedI'm pretty sure the VR errors are either related to saving the newsletter node unpublished and not having the call to the VR module ever get made again or one of the possibilities you've mentioned. I haven't tried it much so I don't know if there's a pattern there. I know while I'm having these problems with the emogrifier.php file the node probably isn't finishing it's publish routine and that's why the VR portion doesn't work.
I just looked at my Vertical Response account and see that none of the test nodes have actually resulted in drafts or campaigns, so it's not sending the information through the API as I expected.
I have tried including a css file through the content/node-type/newsletter advanced form, the file is the theme file at sites/all/themes/mytheme/css/main.css and I've tried it with no css file checked and the result is the same. My theme is a subtheme using the 960gs base theme.
There are no entries related to the enews module at reports/dblog.
For these tests I've only been typing in "test" to the body field and not adding any classes or styles. I am using the wysiwyg module with FCKEditor and the Full HTML input filter.
It occurred to me that when I first tried testing this out I didn't have an active API enabled VR account and got some odd errors as a result. I also didn't have the emogrifier.php file in place when I first activated the enews module. Could having the modules enabled and used without everything in place be a cause for this? Is there something I can look for in the database that would be an indicator that the module didn't get set up right from the beginning?
Comment #5
jbomb commentedI think it'd be best to isolate the issues. I would start by disabling the VR campaign module and possibly downloading a fresh copy of emogriphier. The enews module doesn't add a lot to the database. If I recall correctly there are a few things that get stored in the variables table, but that's it.
Next I would have a look around enews.module and see if there is something wrong with the path that Drupal is using to include emogriphier, and any CSS files. Unfortunately I don't have a lot of time to try and reproduce this on my end this week. I know it's been recently deployed to one of our projects so perhaps I can check in on that.
Please forgive me if you have already looked into this, but it might be worth confirming that any WYSIWYG editor that is present on the content type settings form is excluded from textfield that takes both file paths and raw CSS. I am almost positive that any html, or unnecessary line breaks present in those fields will result in that dreaded white screen.
Comment #6
biscuit.tech commentedThanks - looking at the module earlier I wondered about the paths to the emogrifier file but didn't change anything since I was trying to follow your instructions.
Changing the path on lines 247, 248 seems to fix the issue:
I'll play around with it a bit more in the next couple of days to see if I can break it again, but for now I think that was it.
- David
Comment #7
jbomb commentedIt sounds like that $path variable isn't being set properly. Would you mind logging it's value or printing it to the screen to confirm this?
Comment #8
biscuit.tech commentedThis:
returns this:
I also tried changing lines 247 and 248 to be
And that breaks it.
So despite how little sense it seems to make to me it actually wants the $path in there even though it would seem to return a non-existant path to the file.
Comment #9
jbomb commentedI see. It seems to me that the adjustments in #6 are preventing the enews module from executing that code block, and that leads me to believe that the emogrifier class already exists and is loaded elsewhere in your Drupal installation. I believe PHP is throwing a fatal error when enews attempts to redeclare the emogrifier class on line 248.
Try reverting to the stable release, then apply the attached patch. Once applied, have a look at the enews preview to confirm that the CSS is in fact in-lined. Finally, check watchdog for enews messages. I'm guessing that you should receive a message informing you that emogrifier is loaded elsewhere.
Note, that emogrifier.php must be installed in the emogrifier directory for this debugging patch to function properly.
Please let me know if your find the watchdog record I described, and if the CSS is properly in-lined.
Comment #10
biscuit.tech commentedI ran the patch and things seemed to be broken as before, taking out the leading slash on the path to emogrifier brings it back to sort of working but it's not including a stylesheet so I think in this case "working" means that it can't find the file and does everything except the emogrifier part which is kind of the same as if the file doesn't exist.
No watchdog errors are logged.
Could it be something is missing in my php build?
I just did a quick test using a different server and sub-theme but the same base theme and everything worked as expected.
I'll try to reduce the variables later today to see if I can figure out if it's a module conflict or something in the server configuration, let me know if you have any ideas for things to look for.
thanks!
Comment #11
jbomb commentedPerhaps. Emogrifier requires PHP 5 and DOM extension. There is a similar issue filed in a similar module here... #880140: Module gives silent White Screen of Death if PHP's DOM extension is disabled.
Comment #12
biscuit.tech commentedThat's it!
I needed to install php-xml which provides php-dom
Thanks for all your help!!!
Comment #13
jbomb commentedGlad I could help! Thanks for exposing this issue!.
Comment #14
jbomb commentedSever requirements have been added to the project page.