Closed (fixed)
Project:
Link to content
Version:
5.x-1.x-dev
Component:
Code: Javascript
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Feb 2007 at 20:19 UTC
Updated:
15 Mar 2007 at 21:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
stborchertHi.
Thanks for your work and thoughts.
I've thought and tested a very long time for a fail-safe way to get the drupal installation path within popup.php and talked to others how to do this.
The included code is the result of this. (Btw: its the same way drupal "calculates" $base_url.)
But you can't include settings.php without having the real installation path ($base_url).
set_include_path('../../../../../..' . PATH_SEPARATOR . get_include_path());is not really an alternative because modules aren't restricted to be installed in. If you install tinymce in drupalinst/modules/ the pat(c)h wont work anymore.
There isn't a better solution (yet). In 4.7 I've packaged jquery.js with linktonode but I didn't want to do this because drupal.js includes all the needed functionality.
Don't know how to calculate the base_url in a better way.
Perhaps I can use old js-code from functions.js (4.7.x):
With these lines the path to drupal.js can be build easily. After this I have to include jquery.js with javascript (sound weird; and it is indeed ;-) )
Should be something like this:
I will check this...
Comment #2
stborchertOh damn. Why the hell I try to include drupal.js? I need jquery.js. tsts
The attached patch is not tested (did not have a running drupal inst here).
It loads jquery.js based on the baseURL tinyMCE calculates (this on should be correct) and after this functions.js.
Should work.
Comment #3
awgrover commentedI thought of, but didn't propose something in the same spirit:
Use the environment variable SCRIPT_NAME, and the same sort of substring'ing to find the drupal install directory. Then use that as the set_include_path. Assuming that the install dir can be reliably deduced (as you do for the url). Since you assume the url is reliable for purposes of deduction, and it is mapped to a directory, I think the we can make the same assumption about the SCRIPT_NAME. This avoids the include-via-javascript.
Comment #4
stborchertHi.
You're right, that should do the same. I will test this and create a new patch.
Comment #5
stborchertWell, I've tested this approach but it wont work:
I can include settings.php but
- you do not know if it the correct settings.php (keyword: multisite installations)
- settings.php does not necessarily set a variable called
$base_urlso there's no win in including settings.phpTo avoid the js stuff we only can go back to do something like this:
Comment #6
stborchertUsed the patch for the new release. Using the javascript functions is the easiest and best working solution.
Comment #7
stborchert