Edgewall Software
Modify

Opened 16 years ago

Closed 14 years ago

#7442 closed defect (duplicate)

[header_logo] src and [project] icon does not use htdocs_location

Reported by: cat@… Owned by:
Priority: low Milestone:
Component: web frontend Version: 0.11
Severity: minor Keywords: htdocs_location verify
Cc: mail@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I have following lines in trac.ini

[header_logo]
src = trac_banner.png

[project]
icon = trac.ico

[trac]
htdocs_location = /trac/

And I get in HTML lines like these

<link rel="shortcut icon" href="/trac.cgi/chrome/common/trac.ico" type="image/x-icon" />
<link rel="icon" href="/trac.cgi/chrome/common/trac.ico" type="image/x-icon" />
...
<img src="/trac.cgi/chrome/common/trac_banner.png" ...

I assume they should be relative to htdocs_location as well as other static content.

Attachments (0)

Change History (7)

comment:1 by mail@…, 16 years ago

Cc: mail@… added

I can confirm this. 0.11 on Gentoo.

Tried to fix it like this:

  • /usr/lib64/python2.5/site-packages/trac/templates/theme.html

    old new  
    1717    <div id="banner">
    1818      <div id="header" py:choose="">
    1919        <a py:when="chrome.logo.src" id="logo" href="${chrome.logo.link or href.wiki('TracIni')+'#header_logo-section'}"><img
    20           src="${chrome.logo.src}" alt="${chrome.logo.alt}"
     20          src="${chrome.htdocs_location}${chrome.logo.src}" alt="${chrome.logo.alt}"
    2121          height="${chrome.logo.height or None}" width="${chrome.logo.width or None}" /></a>
    2222        <h1 py:otherwise=""><a href="${chrome.logo.link}">${project.name}</a></h1>
    2323      </div>

The result was an URL like /project/trac-htdocsproject/trac/chrome/common/site/mylogo.png. What I expected it to be: /project/trac-htdocs/chrome/common/site/mylogo.png.

Related config snippets:

[trac]
htdocs_location = /project/trac-htdocs

[header_logo]
src = site/mylogo.png

Maybe someone else knows how to do the fix correctly.

comment:2 by osimons, 16 years ago

You'll want to look at #6562 as that is closely related - and your expected behaviour is even noted as a possible #TODO on the ticket and in the source.

The simple workaround is to use an absolute or server-relative URL for the logo - like /myhtdocs/mylogo.png. That logo source variable will be used as-is by the template.

comment:3 by Remy Blank, 16 years ago

Milestone: 1.0

comment:4 by pek, 15 years ago

I think this has been resolved. My trac.ini is

[header_logo] src = site/logo.png

And it correctly maps to the htdocs of the Trac project ($TRACENV/project/htdocs/logo.png).

comment:5 by Christian Boos, 14 years ago

Milestone: 1.0unscheduled

Milestone 1.0 deleted

comment:6 by Christian Boos, 14 years ago

Keywords: verify added
Milestone: triagingnext-major-0.1X
Priority: normallow

comment:7 by Christian Boos, 14 years ago

Milestone: next-major-0.1X
Resolution: duplicate
Status: newclosed

Seems like this was fixed by r6311, and as such, duplicate of #6471.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.