?
avatar esamo
esamo
29 Mar 2015

Steps to reproduce the issue

Problem noticed after update to 3.4.0.

Expected result

<link href="/templates/joomla3templatebybarryflood/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />

Actual result

<link href="/templatesjoomla3templatebybarryflood/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />

There is no slash after 'templates'.

System information (as much as possible)

System operacyjny   home.pl Linux x86_64
Wersja bazy danych  5.5.41-37.0-log
Porządek znaków w MySQL   utf8_general_ci
Wersja PHP  5.4.37
Serwer WWW  IdeaWebServer/v0.80 (like Apache)
PHP działa na  ucgi5
Wersja Joomla!  Joomla! 3.4.0 Stable [ Ember ] 24-February-2015 23:00 GMT
Wersja platformy Joomla!    Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
Klient użytkownika Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.74 Safari/537.36

Additional comments

Fixed by modyfing libraries/joomla/document/html/html.php commenting line 303 and adding one after, pointing the favicon in images main folder.

//$href = str_replace('\\', '/', $href);
$href = 'images/favicon_peach.ico';

No extra plugins working.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar esamo esamo - open - 29 Mar 2015
avatar esamo esamo - change - 29 Mar 2015
Labels Removed: ?
avatar esamo
esamo - comment - 29 Mar 2015

To be precise

The problem affects only favicon link, not other paths generated by head.php, although it is the only path containing templates part.

I guess somewhere is no more \\ after templates and thus not changed to /???

Result of head.php before modification as follows

<base href="http://peachpolska.eu/" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="Joomla" />
<meta name="generator" content="Joomla! - Open Source Content Management" />
<title>Start - Peach - materiały biurowe</title>
<link href="/templatesjoomla3templatebybarryflood/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>
<script src="/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>
<script src="/media/jui/js/jquery-migrate.min.js" type="text/javascript"></script>
<script src="/media/system/js/caption.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(window).on('load',    function() {
    new JCaption('img.caption');
    });
</script>


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6606.
avatar esamo esamo - change - 29 Mar 2015
The description was changed
avatar pcmitsis
pcmitsis - comment - 29 Mar 2015

Can you try also with the code of the staging branch? I tried to reproduce your error but everything worked fine with the staging branch!

avatar N6REJ
N6REJ - comment - 29 Mar 2015

yeah, staging branch works fine with protostar, can you explain better the error and what template?

avatar brianteeman
brianteeman - comment - 29 Mar 2015

Are you using windows?

avatar esamo
esamo - comment - 29 Mar 2015

As a user during error I was using Windows 7 x64, yes.

Now I am not about checking the error out because website is published. I can copy the files to local server and experiment though... I'm certain that pure installation 3.3.6 was OK (favicon replacement in template location worked) and noticed the bug after 3.4.0 update - but not sure if this is the cause.

I was changing nothing else in Joomla itself as far as I remember, just the main template PHP file and styles.


What is staging branch and how do I apply it?


This is template blueprint xml (template itself I've created out of static HTML project):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.6//DTD template 1.0//EN"     "http://www.joomla.org/xml/dtd/1.6/template-install.dtd">
<extension version="3" type="template" client="site">
    <name>Joomla 3 Template By Barry Flood</name>
    <creationDate>22 january 2011</creationDate>
    <author>barry flood</author>
    <authorEmail>info@barryflood.com</authorEmail>
    <authorUrl>http://www.barryflood.com</authorUrl>
    <copyright>barry flood</copyright>
    <license>barry flood</license>
    <version>2.5.0</version>
<description>Base Master Template</description>

<files>
    <folder>bat</folder>
    <folder>css</folder>
    <folder>html</folder>
    <folder>images</folder>
    <folder>javascript</folder>
    <folder>js</folder>
    <folder>search</folder>
    <filename>index.html</filename>
    <filename>index.php</filename>
    <filename>templateDetails.xml</filename>
    <filename>template_preview.png</filename>
    <filename>template_thumbnail.png</filename>
    <filename>favicon.ico</filename>
    <filename>component.php</filename>
    <filename>error.php</filename>
    <filename>rollover.js</filename>
</files>

<positions>
    <position>navigation</position>
    <position>footer</position>
    </positions>
</extension>
avatar brianteeman brianteeman - change - 30 Mar 2015
Labels Added: ?
avatar brianteeman brianteeman - close - 12 Nov 2015
avatar brianteeman brianteeman - change - 12 Nov 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-11-12 16:18:48
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 12 Nov 2015

It has been 8 months since this was created. From the information provided it sounds that this is an issue with the specific template and not the Joomla core.

If you are still having this issue it can always be re-opened - please provide the exact code that you are using for the favicon link in your template


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6606.

avatar brianteeman brianteeman - close - 12 Nov 2015
avatar baster33
baster33 - comment - 14 Jan 2016

Hello, I found this issue is not with the specific template but Joomla core. (Tested on 3.4.5 but newest version 3.4.8 has same code for setting favicon).
What i found is that link is generated wrongly when your JPATH_BASE constant is set to /. It happens in function _loadTemplate (line 590 of libraries/joomla/document/html/html.php file):

// Try to find a favicon by checking the template and root folder
$icon = '/favicon.ico';

foreach (array($directory, JPATH_BASE) as $dir)
{
    if (file_exists($dir . $icon))
    {
        $path = str_replace(JPATH_BASE, '', $dir);
        $path = str_replace('\\', '/', $path);
        $this->addFavicon(JUri::base(true) . $path . $icon);
        break;
    }
}

Part:

$path = str_replace(JPATH_BASE, '', $dir);

When JPATH_BASE is / than his line replace all directory separators from $dir. Thats why link is /templatemy_template instead of /template/my_template.

In my opinion the solution is to replace only first occurance of JPATH_BASE in $dir string.
I made it by replacing that line with:

$pos = strpos($dir,JPATH_BASE);
if($pos !== false) {
    $path = substr_replace($dir,'',$pos,strlen(JPATH_BASE));
}

Hope I hellped.

avatar ethernidee
ethernidee - comment - 7 Feb 2018

Sadly, that there is no means to prevent Joomla from generating default ico favicon link. We cannot unset doc->_links, because link as added after template file. We'd like to use favicon generators like:

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="theme-color" content="#ffffff">

But Joomla's last inserted icon will overwrite them for search engines.

avatar brianteeman
brianteeman - comment - 7 Feb 2018

@ethernidee commenting on a closed issue will not be seen. Please create a new issue and if necessary add a link to this one

Add a Comment

Login with GitHub to post a comment