Using library version 3.0.83 I can't enable the autoloader function.
Autoloader is not available, update to the latest version of the Syntaxhighlighter javascript library to get this functionality.
Using library version 3.0.83 I can't enable the autoloader function.
Autoloader is not available, update to the latest version of the Syntaxhighlighter javascript library to get this functionality.
Comments
Comment #1
mattyoung commentedThis indicates the autoloader was not found for some reason. Can you look in the syntaxhighlighter js library, inside the script directory to see if there is the file "shAutoloader.js"? The directory should contain these files:
Can you try downloading the syntaxhighlighter js library again and re-install?
Comment #2
jelle_sThe file is where it's supposed to be but I did manage to find the problem.
I'm working with wamp and printed the path where it looks for the autoloader.
The printed path was:
I placed my drupal installation in a map called 'drupal' in my www folder, as you can see, this folder isn't included in the path.
This is because $_SERVER['DOCUMENT_ROOT'] returns "C:/wamp/www/" (with trailing slash), and $path . '/scripts/shAutoloader.js' returns "/sites/all/libraries/syntaxhighlighter_3.0.83/scripts/shAutoloader.js" (with beginning slash).
So I found two suggestions for a solution.
to
(The substring is needed or you will have to forward slashes right after each other)
to
This way the path is always relative to the drupal installation folder
Personally, I would recommend the second solution, as I don't know how the first will react on a server, I haven't tested that yet.
I hope this helps :-)
Comment #3
mattyoung commentedThanks for figuring this out. I took your recommendation and do the search with relative path. It's check in to HEAD. Can you test the 'dev' version?
Comment #4
jelle_sI can enable the autoloader now, with the def version, but it still isn't working. I'll figure out why and give you more details asap.
Comment #5
jelle_sI figured out the problem. I'm guessing this problem is windows-related only.
_syntaxhighlighter_file_directory_path() returns "\sites\default\files" on my wampserver (notice the backslashes).
So on ~ line 92 of syntaxhighlighter.module you do
this, in my case, comes down to
so backslashes and forward slashes are mixed in the file path, which my browser appearantly doesn't like.
So you could fix this, for now, by changing line 443 of syntaxhighlighter.module from
to
(basically replacing backslashes with forward slashes)
Although this seems more like an issue for the drupal_realpath function to me.
And then, finally, my last point:
Probably because I didn't read the documentation right, but I assumed enabling the autoloader just loaded the brushes dynamically, regardless whether they were enabled or not. Appearantly they still need to be enabled to be autoloaded, my mistake.
So I think that resolves the autoloader issue.
And may I just say:
This really is a great module.
Comment #6
mattyoung commentedThank you for figuring out the problem. I added your fix to replace "\" with "/".
I don't know what to make of this. If
drupal_realpath()only returns "/", then it's different from DRUPAL_ROOT, which get its value fromgetcwd()which gives "\" under Windows. However,drupal_get_path()does always return "/".To avoid this confusion, I added a little bit of javascript to turn on all languages when the "Autoloader" is turn on.
Please test the "dev" version.
Comment #7
jelle_sI don't know what to make of this. If drupal_realpath() only returns "/", then it's different from DRUPAL_ROOT, which get its value from getcwd() which gives "\" under Windows. However, drupal_get_path() does always return "/".
Yes, exactly my point.
It seems to me that there could be more consitency in those functions, just to avoid confusion,
or maybe that's more like a feature request... Anyway, it's not really an issue for this module,
or at least not anymore :P
I will test the dev version as soon as I find some time to do it.
Comment #8
jelle_sEverything seems to work. As far as I can tell, the bugs seem to be fixed.
Comment #9
mattyoung commented