salesforce_api.module currently uses libraries_get_path() in one of it's calls to define():
define('SALESFORCE_DIR_TOOLKIT', libraries_get_path('salesforce') . '/toolkit');
The problem with this is if the module weight of libraries or salesforce_api is changed so that libraries is loaded after salesforce_api, then this generates a WSOD. ie, the only reason it works by default is because they have the same weight and salesforce_api is alphabetically later.
Perhaps this could / should be made more robust for the odd user who starts playing around with module weights via the Util module?
Comments
Comment #1
kostajh commentedThat sounds fine to me, a patch would be welcome.
Comment #2
EvanDonovan commentedI guess we would have to check function_exists, and if it didn't, fall back on just looking at "sites/all/libraries"?
The side effect then would be that Libraries would not be a hard dependency anymore, either.
Comment #3
kostajh commentedThe Salesforce API module can't be installed with an install profile until this is fixed.
Here's a patch using the approach in comment #2.
Comment #4
kostajh commentedSorry, small error in the patch above.
Comment #5
kostajh commentedThis patch also removes Libraries as a dependency in the .info file, and updates the README (my editor also removed all the trailing spaces from the README... so the patch is a bit larger than it should be).
Comment #6
brianV commentedkostajh:
Just a thought, this breaks if you are using a multi-site install and don't have libraries installed.
We should do something like the below - it should work for multi-site, install profiles, and normal sites. Also, should be reasonably performant if variable_set() and variable_get() work in this context. Finally, would remove the need for Libraries altogether as it checks the same paths in the same order.
Sorry for not providing the below as a patch - it started as 'back of envelope' code to illustrate what I was trying to describe, and bloomed into below. I can set up the salesforce repo and create it as a patch if necessary.
Comment #7
kostajh commentedThanks brianV, that looks good and works correctly. Here it is as a patch. I added a line to use Libraries API if it is available.
Comment #8
kostajh commentedCommitted to 7.x-2.x: http://drupalcode.org/project/salesforce.git/commit/5fb5cfa
Comment #9
kostajh commentedMade a few small corrections here: http://drupalcode.org/project/salesforce.git/commit/3c79c8f
Comment #10
kostajh commented