Support Forum

  • Page:
  • 1

Wrong path for local versions of jQuerry and noconflict.js (Localhost - XAMPP)

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hello!

First of all, thank you for this great plugin.
I have small issue with latest version of plugin for Joomla 1.7 (JB_jblibrary_J1.7_1.2.0.zip)

I can't load any of local versions of jQuery (copy from Google is loaded correctly)
After choosing local jQuery in source code on front I see wrong paths to files in head section:
(I attach screenshot of source code as I can't paste code here)

src="/newfp1\media\plg_jblibrary\jquery\/newfp1\media\plg_jblibrary\jquery\jquery-1.7.0.min.js"

src="/newfp1\media\plg_jblibrary\jquery/jquery.noconflict.js"

I'm working on localhost - XAMPP v 2.5

PHP Version 5.3.1 , MySQL: 5.1.41
Joomla 1.7.3
Default Beez5 Template

maybe you guys have some suggestions tips, what can cause this behaviour?

Thank you in advance for taking time to read this and any answer :)

Greetings

Tom
Attachments:
  • synth's Avatar
  • synth
  • Free Extensions
  • 2 posts
  • Karma: 0
Last Edit: 12 years 4 months ago by synth.
The administrator has disabled public write access.
Hello Guys, small update, I checked JB jblibrary on my online server and everything seems to work properly. So something is causing problems on my XAMPP installation, did you notice maybe some incompatibility with XAMPP localhost? (or maybe PHP 5.3.X? my online server have 5.2.X version installed) (till now I didn't have any problems with Joomla and any of extensions on this localhost and I would love to make it work here).
Suggestions are appreciated :)

Tom
  • synth's Avatar
  • synth
  • Free Extensions
  • 2 posts
  • Karma: 0
Last Edit: 12 years 4 months ago by synth.
The administrator has disabled public write access.
Hi there!

I can confirm that behaviour on my local xampp installation.

My configuration:
xampp 1.7.4
Mysql 5.x
PHP 5.3
JBLibrary 1.7.1.2.0
Joomla 1.7.3

I traced it back from plugins\system\jblibrary\jblibrary.php -> onAfterInitialise() -> Line 63 ff.
The call for $document->addScript($this->_jqpath) is "correct", it uses "\media\plg_jblibrary\jquery\jquery-1.7.0.min.js" as path.

Printing the path in libraries\joomla\document\document.php -> addScript displays the same path.

But if i do a print_r on $document->_scripts in libraries\joomla\document\html\renderer\head.php on line 135ff., the wrong path is in the array.

Something must happen between the addScript and the call in the head.php, but unfortunately i have to work on another problem now.

Try to get back later...

Ben
  • bb_isec's Avatar
  • bb_isec
  • 6 Month Developer
  • 4 posts
  • Karma: 0
The administrator has disabled public write access.
Hi there,

sorry, couldn`t figure it out, I searched occurences of $document->_scripts, but I did not find it.

I think that there is something which is adding the un-needed \media\plg_jblibrary\jquery\ somewhere deeper in the core. I don`t have the time to search further, so unfortunately i`ll keep on using the google version and try to switch again to local when I am on my linux based server.

If anyone has an idea, i would be happy to know :)

Greetz
Ben
  • bb_isec's Avatar
  • bb_isec
  • 6 Month Developer
  • 4 posts
  • Karma: 0
The administrator has disabled public write access.
I think this looks like an issue with backslashes vs forward slashes from the looks of the file paths above.

The path constants look like the slashes are correctly namespaced int eh file. But are you able to see if printing the values for the following sheds any light not he issue:
$modbase = JURI::root (true).DS.'media'.DS.'plg_jblibrary'.DS;
    	$jsbase = $modbase.'jquery'.DS;
		$helperbase = JPATH_SITE.DS.'media'.DS.'plg_jblibrary'.DS.'helpers'.DS;

Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Hi Anthony,

thanks for your reply!

I put your paths in my local source and got the following results:

Output in plugins\system\jblibrary\jblibrary.php on Line 58,
after "if(JFactory::getApplication()->get('jquery') == false) {"

modebase = \media\plg_jblibrary\
jsbase = \media\plg_jblibrary\jquery\
helperbase = D:\Data\Devel\src\media\plg_jblibrary\helpers\



Output in libraries\joomla\document\html\renderer\head.php
just before "//Generate script file links" ca. line 135

modbase = \media\plg_jblibrary\
jsbase = jquery\
helperbase = D:\Data\Devel\src\media\plg_jblibrary\helpers\

Unfortunately I´m not that deep into joomla source (lack of time :( ), so I really appreciate your or anyone else` help!

Greetings

Ben
  • bb_isec's Avatar
  • bb_isec
  • 6 Month Developer
  • 4 posts
  • Karma: 0
The administrator has disabled public write access.
For it to work in bot linux and window change line 52
from
$modbase = JURI::root (true).DS.'media'.DS.'plg_jblibrary'.DS';
to
$modbase = JURI::root (true).'/media/plg_jblibrary/';
The error is cause because the path separator in window is "\" while for browser except "/"






www.bluelinktech.com
  • dedan's Avatar
  • dedan
  • JB Pro
  • 2 posts
  • Karma: 0
The administrator has disabled public write access.
Thanks for the fix :)

Ive added it to the tracker and will get a new version out today.

Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Hi guys,

unfortunately, the fix did not work for me.

I`m running Joomla 1.7.3, JB Library 1.7_1.2.1 and I´m getting the following 404´s:

csd.localhost//media/plg_jblibrary/jquery//media/plg_jblibrary/jquery/jquery-1.7.0.min.js

csd.localhost/templates/jbmeridian/css/-1.css (i think this is not very relevant to the problem but maybe its useful in a way?!)

And my major thought about the fix is: if "DS" is defined the right way (based on the used system), the line shouldn`t need to be changed at all... I did not recognize at change for line 52 in jblibrary at all (while switching vom 1.2.0 to 1.2.1)

So the problem must be somewhere else?

Ben
  • bb_isec's Avatar
  • bb_isec
  • 6 Month Developer
  • 4 posts
  • Karma: 0
The administrator has disabled public write access.
My understanding is that, in joomla window use "\" to separate file path and linux uses "/".
If you develop or host the website in linux it will have no issues, but if you develop it in window the path will be wrong.
To solve this i changed DS to "/" like in below code snippet.

//module base
$modbase = JURI::root (true).'/media/plg_jblibrary/';
$jsbase = $modbase.'jquery/';

i have attach the modified file that i use.



www.bluelinktech.com
Attachments:
  • dedan's Avatar
  • dedan
  • JB Pro
  • 2 posts
  • Karma: 0
Last Edit: 12 years 3 months ago by dedan.
The administrator has disabled public write access.
This is a strange one. Normally .DS. should be interpreted as a directory seperator correctly; whatever the system. That's why it is preferable to use that than hard code a forward or backslash.
  • Seth's Avatar
  • Seth
  • Moderator
  • 8358 posts
  • 225 Thanks
  • Karma: 202
The administrator has disabled public write access.
Sorry for the delay ion this one.

Ive added it to the tracker to investigate further.

Cheers Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
HI,

The DS is working well, the problem here is that in 'src' attribute for script tags you are not calling local directories, but URLs! So you can't use DS, because it was written to be used as local directory separators, not URLS.

I fixed it in trunk, using what dedan suggested.

Anderson
  • Anderson Grüdtner Martins's Avatar
  • Anderson Grüdtner Martins
  • LIfetime Developer - Big Bamboo
  • 94 posts
  • 10 Thanks
  • Karma: 8
The administrator has disabled public write access.
Thanks - just released the fix.
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers