Closed (fixed)
Project:
Messaging
Version:
6.x-2.1
Component:
PHPMailer
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Aug 2009 at 16:31 UTC
Updated:
14 Jul 2010 at 15:14 UTC
Jump to comment: Most recent file
Comments
Comment #1
danepowell commentedI don't have any other modules using phpmailer installed, so I can't test that this solves the problem, but I can at least say that it doesn't break anything. Thanks for the report and fix.
Comment #2
danepowell commentedI wonder if a better solution in the long-run wouldn't be to make a separate module just to contain PHPMailer, so that administrators don't have to maintain multiple copies of it in multiple modules (and to avoid problems such as this).
Comment #3
batje commentedIt does make sense, but I read some posts that discuss the changes to the Drupal mailer in D7 are going to be significant and cater for this kind of thing.
Comment #4
markus_petrux commentedhttp://drupal.org/project/phpmailer
- #563112: PHPMailer support for Libraries API!
[EDIT] I have posted a patch to the above mentioned issue, and aside from depending on Libraries API, the PHPMailer class is loaded on demand. Maybe other modules such as messaging_phpmailer in need of the PHP Mailer class could depend on PHPMailer module?
Anyway, if messaging_phpmailer cannot depend on PHPMailer module, then maybe it could depend on Libraires API. This would allow site administrators place the PHPMailer class on a common location that can be shared with other modules in need for this library. And it makes it a lot easier to upgrade Messaging package versions because the PHPMailer class would located on a separate location, which is the point of the Libraries API.
Comment #5
jose reyero commentedOk to use libraries and also checking for PHPMailer. However I'd like it to fallback to current location so people with existing installs don't see them breaking after upgrade. Some chained if-then will be fine.
Comment #6
markus_petrux commentedHow about this?
PS: Before trying the patch, line endings in messaging_phpmailer.install need to be fixed in the repository. It is now using CRLF!
Comment #7
markus_petrux commentedOops! fixing typo in watchdog message: s/Could/Could not
Comment #8
markus_petrux commentedFor the record: here's a good reason to keep 3rd party libraries off the modules directories: #546584: Modules or themes with too many files kill drupal_system_listing performances. ie. less subdirectories under modules directory means less job for drupal_system_listing().
Comment #9
jose reyero commentedThis looks very good. Just about the logic, could be cleaned up a little bit
Also note we remove './.' from paths. Does this look good / works?
Comment #10
markus_petrux commentedThanks for taking the time to review the patch.
1) Removing './.' from paths will work, but PHP will first look at include_path directories. The './' prefix makes PHP ignore include_path altogether. So this is used for perfomance reasons.
http://www.php.net/include
2) We cannot invoke libraries_get_path() if we haven't checked first if libraries module exists.
I tested the patch in #7 with and without PHPMailer class, with and without libraries module. And worked here, but it would be nice if someone else (other than me) can confirm this.
Comment #11
markus_petrux commentedtagging
Comment #12
jose reyero commentedFair enough, applied patch in #7
Thanks.
Comment #14
alleycat7 commentedNoob question: where would I put that code?
Thanks
A
Comment #15
socialnicheguru commentedhas this been committed?