?
Referenced as Related to: # 5085
avatar waveywhite
waveywhite
10 Nov 2014

In index.php for the protostar template the css and javascript links are relative. With SEF & .htaccess enabled this causes the template to attempt to load these files relative to the current path. These paths map to the component and Joomla tries to map them to a page and outputs HTML instead of the desired CSS file.

To recreate this bug:
Create a new Joomla install with Protostar as default template and no content
1. Enable SEF links via the global settings & copy htaccess.txt to .htaccess in web root
2. Create a new article in the admin site (id should be 1)
3. Manually enter the article name via the url siteurl/component/content/article/1

solution: prepend these with JUri::base calls to build the proper CSS and javascript paths.

-David.

avatar waveywhite waveywhite - open - 10 Nov 2014
avatar jissues-bot jissues-bot - change - 10 Nov 2014
Labels Added: ?
avatar Bakual
Bakual - comment - 10 Nov 2014

I can't reproduce this here.
The files are loaded relative to the site root, starting with a slash. So the browser should ignore the path and call the files from the proper place.

Can you be more specific with which enviroment you're testing this?

avatar Fedik
Fedik - comment - 10 Nov 2014

I suppose you have disabled a "System - SEF" plugin, right? :smile:

avatar waveywhite
waveywhite - comment - 10 Nov 2014

I have disabled the SEF plugin, yes. I guess that must be a factor as well! Thanks, Fedik.

I need to do that for performance reasons (the SEF plugin is lousy with embeded SVGs). Still, this problem doesn't happen in Beez and Protostar isn't following recommended practice (http://docs.joomla.org/Creating_a_basic_Joomla!_template) so I think it's still a bug.

To reproduce bug:
1. Enable SEF links via the global settings & copy htaccess.txt to .htaccess in web root
2. Create a new article in the admin site (id should be 1)
3. Disable SEF plugin
4. Manually enter the article name via the url siteurl/component/content/article/1

The file is templates/protostar/index.php. The line numbers in question are 41 and 43. The environment is Ubuntu 14.04 with Apache 2.4.7

avatar dgt41
dgt41 - comment - 10 Nov 2014

Can you replace $this->baseurl with JUri::base() and if it works then make a PR?

avatar waveywhite
waveywhite - comment - 10 Nov 2014

Hi dgt41. Who would you like to do this?

Either this->baseurl or JUri::base() should work, a the moment neither is in place. Which is preferable?

avatar Bakual
Bakual - comment - 10 Nov 2014

Can you create a Pull Request then? See http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests for how to do it.

If you do, you will get proper credits for doing it :smile:

avatar Bakual
Bakual - comment - 10 Nov 2014

Either this->baseurl or JUri::base() should work, a the moment neither is in place. Which is preferable?

In theory, `$this->baseurl should be a bit faster, so I'd use that.

avatar jissues-bot jissues-bot - close - 11 Nov 2014
avatar jissues-bot
jissues-bot - comment - 11 Nov 2014
avatar brianteeman brianteeman - change - 11 Nov 2014
Status New Closed
avatar jissues-bot jissues-bot - change - 11 Nov 2014
Closed_Date 0000-00-00 00:00:00 2014-11-11 09:58:41

Add a Comment

Login with GitHub to post a comment