Problem with baseurl in error.php

Feel free to talk about everything related to our Joomla Products
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Mon Jan 21, 2013 12:13 am
Hello,

I've noticed when encountring a 404 page that clicking on the logo does not send the user back to the "baseurl" (homepage) of the site, it does send them back to the url/menu/ where the item is located, which does popup another 404 page and the user is lost.

When looking into the error.php file I noticed 2 things :

1- this line :
Code: Select all
<a href="./" id="gkLogo" class="cssLogo"></a>


This may look weird, but I've checked in 3 different websites (2 on different hosts) and noticed that in the 3 sites (running a gavick template) the behavior is kinda different while all of the 3 do use that same line in error.php :

http://tourisme.nadorpresse.com, when you get to a 404 page, i.e if you try to go to tourisme.nadorpresse.com/test/article.html and look at the source, you find this code generated :
Code: Select all
<a href="./" id="gkLogo" class="cssLogo"></a>
, but when you click in the logo you get to the page tourisme.nadorpresse.com/test/.

http://nadorpresse.com (different template), when you land in a 404 page and look at the source you'll find the exact same line, but when you click on the logo you land on the homepage.

http://www.dallascoiffure.be (different host and template), i.e on dallascoiffure.be/test the source code shows some different line :
Code: Select all
<a href="[b]/./[/b]"><img src="http://www.dallascoiffure.be/images/logo.png" alt="Accueil" /></a>
, while the error.php has the exact same code as the other templates.

In my case I just modified the
Code: Select all
<a href="./" id="gkLogo" class="cssLogo"></a>
from error.php in tourisme.nadorpresse.com to
Code: Select all
<a href="<?php echo JURI::base(); ?>" id="gkLogo" class="cssLogo"></a>


2- In the same file and for every other template, the code generating the link for the homepage (in the bottom of error.php) is :
Code: Select all
<a href="<?php echo $this->baseurl; ?>/index.php"
, but when you check any source code including in the demo site, you'll always find an url "/index.php", no "baseurl" generated or included, if you try to remove the last part /index.php and take a look at the code, no url is generated, the a href is empty and set to "".

Something is wrong with $this->baseurl and replacing it with
Code: Select all
<a href="<?php echo JURI::base(); ?>"
fixes the problem.

Anyone to take a look at this and see where comes the problem from, please?
User avatar
Senior Boarder

GK User
Mon Jan 21, 2013 10:35 am
Hi,

You're right - the JURI::base() method should be used on the error and offline pages, because the $this->baseurl property won't work on error.php and offline.php files. I'll report it to the nearest Gavern Framework Update.
User avatar
Administrator


cron