Opened 11 years ago
Last modified 10 years ago
#11169 closed enhancement
`render_resource_link` should add the "missing" class if the resource doesn't exist — at Initial Version
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.1.2 |
Component: | rendering | Version: | 1.0-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
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.