#11169 closed enhancement (fixed)
`render_resource_link` should add the "missing" class if the resource doesn't exist — at Version 4
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.2 |
Component: | rendering | Version: | 1.0-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: |
When |
||
Internal Changes: |
Description
In the case that get_resource_description
doesn't return an Element
, render_resource_link
should check whether the resource exists and add the missing
class if it doesn't.
This is mainly useful for plugins at the moment, since render_resource_link
is only utilized once in the Trac source. In this one case that it is used, a context
parameter is passed, so an Element
will be returned by render_resource_link
and the pathway that this ticket proposes to modify is not being executed in that case.
I've prepared a patch in ff9c10ec. I don't like how the test case adds a dependency on trac.wiki.model.WikiPage
, but I didn't have any better ideas at the moment and struggled to figure out the right way to code a "dummy" ResourceManager
. I'll iterate on the patch if anyone can provide suggestions on how to improve.
Change History (4)
comment:1 by , 11 years ago
comment:2 by , 10 years ago
Milestone: | → 1.1.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:3 by , 10 years ago
The test cases have been improved. Revised changes proposed in rjollos.git:t11169.2:
- adds the
realm
as a class for the link. - adds the
missing
class and therel=nofollow
attribute to the link if the resource has aResourceManager
and the resource does not exist.
comment:4 by , 10 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed to trunk in [12308].
rel='nofollow'
attribute to the 'missing link'.