# Ticket #8628 (closed defect: fixed)

Opened 2 years ago

## [Patch] bookmark.url not being expanded correctly on sub sites

Reported by: Assigned to: sandinak saigon normal BookmarkPlugin major melissa.k.mcdowell@nasa.gov 0.12

### Description

• I have a site at /trac/atol
• have the most recent bookmarks plugin
• we are seeing this:
    <ul class="bookmarks">
<li class="report">
<a href="/report/8">{8}</a>
Active Tickets, Mine first (<a href="/trac/atol/bookmark/delete_in_page/report/8">delete</a>)
</li>
</ul>


for code that looks like this in the list.html template:

 <ul class="bookmarks">
<py:for each="bookmark in bookmarks">
<li class="${bookmark.realm}"> <a href="${bookmark.url}">${bookmark.linkname}</a>${bookmark.name} (<a href="\${bookmark.delete}">delete</a>)
</li>
</py:for>
</ul>


appears that the bookmark.url is not being expanded correctly.

## Change History

### 05/22/11 09:58:02 changed by helend

• attachment bookmark.patch added.

### 12/02/11 11:11:57 changed by rjollos

• summary changed from bookmark.url not being expanded correctly on sub sites. to [Patch] bookmark.url not being expanded correctly on sub sites.

### 02/11/12 05:41:29 changed by rjollos

#9788, which I opened, is a duplicate.

### 02/12/12 23:07:19 changed by jun66j5

• status changed from new to closed.
• resolution set to fixed.

(In [11271]) Fixed generating wrong bookmark urls if base-path isn't /.

Initial patch by sandinak. Closes #8628.

### 02/12/12 23:27:32 changed by rjollos

Hi jun66j5,

Did you test that patch on bookmarks with hrefs that contain query strings? I did some testing on hrefs that contain query strings in the course of my work on #7399, and then again while starting to work on #9788, and found that using req.href(url) doesn't work for query strings (more details in #9788). I was thinking that req.base_path + url might work better here. I implemented a similar solution for the MenusPlugin in [11166]. I was thinking that a cleaner implementation there might be req.base_path + url.lstrip('/'), but I haven't tried that out yet.

### 02/12/12 23:34:27 changed by jun66j5

• status changed from closed to reopened.
• resolution deleted.

Oh..., you're right. I try now and it doesn't work on url with query string.

### 02/12/12 23:36:57 changed by rjollos

I've seen a similar issue with at least 3 other Trac plugins, so I'll be interested to see what solution you implement since I think you know the Trac API much better than I do. It would be really nice if req.href(..) could just handle query arguments and fragments though.

### 02/12/12 23:39:57 changed by rjollos

Also, I can't say for certain, but think that #8353 was probably resolved by this patch as well. At least, I think I may have experienced that issue yesterday when working in a dev instance of Trac, and prior to this patch.

### 02/13/12 09:32:25 changed by jun66j5

• status changed from reopened to closed.
• resolution set to fixed.

(In [11272]) Follow-up to [11271], fixed generating wrong link when a page with query string is bookmarked.

Closes #8628.

### Add/Change #8628 ([Patch] bookmark.url not being expanded correctly on sub sites)

Change Properties