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.
Labels |
Added:
?
|
I suppose you have disabled a "System - SEF" plugin, right?
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
Can you replace $this->baseurl
with JUri::base()
and if it works then make a PR?
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?
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
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.
Set to "closed" on behalf of @brianteeman by The JTracker Application at issues.joomla.org/joomla-cms/5081
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-11-11 09:58:41 |
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?