Javascript url isn't properly built
First of all, thanks to the development team. Vanilla is the way I see forums : simple and pretty.
I've just installed one and I noticed that none of the Javascript functionalities were active. I looked in the code and it appears that some of the directories separators are missing and it's the reason why the page can't find the scripts.
The same applies to the themes previews pictures but other urls are ok (profile pictures, css, etc.).
Oh and the invitation emails only contain : "EmailInvitation".
In my opinion, the problem is caused by PHP : maybe some option from the hosting provider (online.net) or the version of PHP (according to phpinfo : "PHP Version 5.2.9-1.illimite").
My version of Vanilla is the last one : 2.0.18.4.
Here is a portion of the vanilla page.
<link rel="stylesheet" type="text/css" href="/applications/dashboard/design/style.css?v=2.0.18.4" media="all" /> <link rel="shortcut icon" href="/themes/default/design/favicon.png" type="image/x-icon" /> <link rel="canonical" href="http://forum.***.fr/categories" /> <script src="/jslibraryjquery.js?v=2.0.18.4" type="text/javascript"></script> <script src="/jslibraryjquery.livequery.js?v=2.0.18.4" type="text/javascript"></script> <script src="/jslibraryjquery.form.js?v=2.0.18.4" type="text/javascript"></script> <script src="/jslibraryjquery.popup.js?v=2.0.18.4" type="text/javascript"></script> <script src="/jslibraryjquery.gardenhandleajaxform.js?v=2.0.18.4" type="text/javascript"></script> <script src="/jsglobal.js?v=2.0.18.4" type="text/javascript"></script> <script src="/applicationsvanillajsbookmark.js?v=2.0.18.4" type="text/javascript"></script> <script src="/applicationsvanillajsdiscussions.js?v=2.0.18.4" type="text/javascript"></script></head>
Best Answer
-
x00 MVP
You could try something like
define('PATH_ROOT', '/.');
technically this is bug, but it is a very edge case, most people do not have your setup.
Another way you could do it, put the forum in folder, use .htaccess to rewrite so you preserve your uri structure, and use
$Configuration['Garden']['StripWebRoot'] = TRUE; $Configuration['Garden']['WebRoot'] = forumfolder; //note no preceding or trailing slash
grep is your friend.
0
Answers
Have you tried installing it in a localhost or different server?
Check out my other Plugins here
Am thinking ur missing a /
There was an error rendering this rich post.
in class.controller.php
you have stuff like
$JsPaths[] = PATH_ROOT . DS . 'js' . DS . $JsFile;
then
then
$this->Head->AddScript
...grep is your friend.
note
$Options['path'] = $JsPath;
AddScript in head module refers to
$Attributes = array('src' => Asset($Src, FALSE, GetValue('version', $Options)), 'type' => $Type);
Asset in functions.general.php
grep is your friend.
so I would be looking to see what PATH_ROOT is set as.
Note in index.php
grep is your friend.
are you using
$Configuration['Garden']['StripWebRoot']
perchance?grep is your friend.
Thanks for your help.
I runed it on my localhost (PHP 5.3.8) and there is no problem with the Javascript paths, that's why I think the problem is caused by the PHP configuration. I made no special modification in the source.
No, there is no such line in the configuration.
Yep could be right, it does seem to be a strange version to run on a production server.
I would check to see if you have a choice of php versions.
grep is your friend.
I've managed to have the Javascript working by using an optimization plugin. So, it's ok for the moment.
I'll check if I can have control on the PHP version.
try this script
grep is your friend.
No error displayed.
The output of var_dump is :
yep that is wrong it should show something like /var/www
in index.php you could change
define('PATH_ROOT', '/path/to/www');
in any event ending in / could cause that problem becuase that is what is stripped.
grep is your friend.
Indeed, in my localhost, this value is correct.
Problem is : I don't know how I can get the correct value from the server.
The value of $_SERVER["DOCUMENT_ROOT"] is the same "/" and the only connection I have to the server is FTP.
what is the value of
__FILE__
?grep is your friend.
You could try something like
define('PATH_ROOT', '/.');
technically this is bug, but it is a very edge case, most people do not have your setup.
Another way you could do it, put the forum in folder, use .htaccess to rewrite so you preserve your uri structure, and use
grep is your friend.
The trick with '/.' worked.
I'll find more time later to make it clean with the .htaccess.
Thank you very much for your help!
Cough
There was an error rendering this rich post.
oh dear is it itchy and dry or chesty? Or the option that no remedy seems to mention red raw?
grep is your friend.