-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anomaly in site title link #5272
Comments
cannot confirm |
@brianteeman & @richard67 (as you have tested too...) This is with SEF: ... and this is without SEF: |
substitued SEF screenshot as there was something ill in the address bar (It still displayed non-sef address...) |
ah i see ... well i have my local joomla in a subdirectory, so i always have a href="/joomla3" ... maybe this is the reason why i cannot reproduce, because the problem exists only if joomla is located in the root directory (whish is of course the default for production sites). |
can be... |
@richard67: check if with SEF you have /joomla3/ and without /joomla3 |
@smanzi no, I have in both cases "/joomla3". |
... unsure... I'll think it over... In the meanwhile I can confirm that I have this also on the production VPS in Amsterdam, so this is not a trick by my local poltergeist... |
you can see at http://test.smz.it |
yes, i see there. well, it comes from the link target being empty sting, and so someone who is more into it has to decide if the protostar template shall be changed from |
... or if it is a more general issue |
more general? i think JUri::base would be very general ;-) |
yeap, you seems to be really right! flu making me retard... 😖 |
I think the protostar index.php and error.php have to be changed so they append a slash to $this->baseurl when using it for the site title link. Using JUri::base() instead of $this->baseurl would also be ok, but silly, and anythign else - change the JUri::base function itself or changing the function which sets $this->baseurl would cause a mess because require lots of calling programs to be changed. If I get positive feedback on this idea, I can try to make the pull request. I am not very experienced with this but I would do my best ;-) |
@brianteeman what do you think about the above results? |
Question is: why when SEF URL are active we get a neat "/" ? furthermore, few lines above $this->baseurl is used to build the path to a JS, and this is working for both SEF and NON-SEF... puzzled... |
look NOW at my site: SEF active, neat "/" then we should have two // in the JS for lt IE9, but we don't... |
@smanzi Because the sef plugin does this when rewriting the URL, see plugins/system/sef/sef.php, function onAfterRender, where everything starts with "$base = JUri::base(true) . '/';". |
@smanzi But you are right, we cannot just append a "/" in the template when SEF is on. So either we make a bit of code in the template to append "/" only if "", or we use JUri::base instead of $this->baseurl in the template, or $this->baseurl has to be initialized with "/" in function _fetchTemplate in libraries/joomla/document/html/html.php (or wherever else it originally comes from) when it otherwise would be the empty string. |
I don't want to break something I don't fully understand... better leave this to more experienced hands... |
yes, sure, I hope they have a look on it and our discussion at least helps them to find out how it has to be solved in the proper way. |
(resetting my site to NON-SEF, for reference...) Yeah... I'm confident someone will jump in... |
I think this is a minor issue (most are using SEF URLs), but anyway... for the sake of code quality... |
@smanzi before anything else can you unmute (or else comment it ) this |
tried: I've nuked .htaccess, but no success... |
ah sorry, the contrary... |
wait.. |
@dgt41 hmm on a clean fresh new default install there is no .htacess in effect ... and it should also not be necessary. |
I now have RewriteBase /, but still no success... |
@richard67 you are right, but this is apache option control over .htaccess |
TBH, I don't know! I'm on skype with Dimitris and he has asked me to... it works here with both sef and non sef, but I'm in root... and we want to chheck if it works when in subdir... |
@smanzi I did, with JUri::root, and now I get "/joomla3/" in any case (homepage and other, i.e. login page, both with and without SEF URLs). But why JUri::root and not JUri::base? Other templates use JUri::base. |
hold on... |
JUri::base A static method that returns the base URI of the Joomla site. I guess base is better ? |
Actually this should be echo $this->baseurl . '/'; |
will not I get // with SEF? Let me try... |
nope |
@dgt41 If Joomla has been installed in the web server's document root then this method will return "/" for the path ... this is what the docu says, but a few lines below is an explanation of the $pathonly parameter, as is with JUri::base, but it is not clearly told what $pathonly does in case of document root. From my point of view, behavior of JUri::base and JUri::root should be the same at this point, but maybe it isn't. For @smanzi i think the solution I have tested will result in "//" with SEF URLs on, or not? |
confirmed OK both SEF and NON-SEF with |
@dgt41 and @smanzi I think we should use echo $this->baseurl . '/'; in the template. The docu sais that this is equivalent to JUri::base(true) . '/'. |
Let it be |
Whoever it does should not forget error.php. |
@richard67 do you want to check that it works when J! in subdir and do the PR yourself? |
... you will quickly get at least 2 @test 😄 |
I do so. I come back to you here in case of problems/questions. |
no prob... I'm here... quite busy as I have to make a mailing... but I'm here... sergiomanzi on Skype if you wish... |
We have a PR #5291 |
joomla#5291 inadvertently reverted by @richard67 - this re-instate its code...
Seen this in protostar and I don't know if this is a template ore core issue:
While SEF URLs are activated the site title
<a class="brand pull-left">
points to the site root (expected), while when NON SEF are in function the link points to the current page (unexpected).The text was updated successfully, but these errors were encountered: