hi,
I have been taking a look at this module during the last days and it does not seem good practice to put the path to the library into a variable. I haven't gotten it to work locally that way.
So I went ahead and implemented the libraries API into this. That way other modules can use the library too and there is no need to tinker in the code. Just upload the library to /sites/all/libraries/swiftmailer.
I have also implemented load functions and I have rewritten the swiftmailer_validate_library function to use the functionality provided in libaries API.
I have also removed the return TRUE that was there and effectively turned of the validation of the library.
This is actually the first time I am contributing code to a drupal project so go gentle on me ;)
Matt.
Comment | File | Size | Author |
---|---|---|---|
#14 | libraryload-2620822-14.patch | 4.52 KB | matthias_bauw |
|
Comments
Comment #2
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedthis is the patch file
Comment #3
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedComment #5
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedtest failed :) Well that's no surprise. I have removed 2 lines of code that weren't necessary but were left behind while debugging.
This one will probably fail too
Comment #6
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedComment #9
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedOk I hope nobody minds me just trying some things out as this is all new to me. I changed the test file to install the libraries dependency
Comment #10
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedComment #14
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedok another attempt, changed the order in wich modules are installed in test, maybe that is the reason why it fails.
#nevergiveup
Matt.
Comment #16
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedComment #18
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedComment #19
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedComment #20
sbrattla CreditAttribution: sbrattla as a volunteer commentedHi DragonEye,
Thanks for taking the time to contribute to this module. I see you've submitted a patch a few times. How are things progressing?
Comment #21
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentednot very well and I have come to a conclusion that it's probably not necessary what i was doing. Well I came to the conclusion quite early but I was trying to get that test passed :)
The idea of implementing the libraries API is probably not the best since you can use composer to install the swiftmailer library. The weird thing is that I couldn't get it to work locally. No matter what I tried, it wouldn't load. So I tried to see if my drupal installation was to blame. I am trying to reinstall my drupal 8 and I'm gonna see if I can get the module to load just by using composer to download the library.
Comment #22
matthias_bauw CreditAttribution: matthias_bauw as a volunteer commentedhmm... very strange. I have started a blank install on D8. I have installed swiftmailer library through composer and mail system and again I am getting the error
Fatal error: Class 'Swift_Message' not found in /wwwroot/gollum/public_html/modules/swiftmailer/src/Plugin/Mail/SwiftMailer.php on line 176
The idea can't be to change the path in the code if you ask me. That would require me to change it every time I install a new version.