#11100 closed enhancement (wontfix)
tracopt.ticket.deleter Genshi stream transformer may not work with themes
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | ticket system | Version: | 1.0-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The XPath expression relies on an h3
being present, but a theme may want to change this to, for example, an h5
. Would there be any harm in the following change, since the id
elements must be unique anyway:
-
tracopt/ticket/deleter.py
diff --git a/tracopt/ticket/deleter.py b/tracopt/ticket/deleter.py index 75b93fa..75b1724 100644
a b class TicketDeleter(Component): 95 95 96 96 buffer = StreamBuffer() 97 97 return stream | Transformer('//div[@class="description"]' 98 '/ h3[@id="comment:description"]') \98 '/*[@id="comment:description"]') \ 99 99 .after(delete_ticket).end() \ 100 100 .select('//div[starts-with(@class, "change")]/@id') \ 101 101 .copy(buffer).end() \
This would also seem to be more robust against future changes to the Trac ticket template.
Attachments (0)
Change History (7)
follow-up: 2 comment:1 by , 12 years ago
Milestone: | → 1.0.2 |
---|
comment:2 by , 11 years ago
follow-up: 4 comment:3 by , 11 years ago
The "delete button" you mean? I think 1.1.x would be a good target for this. If we want to fix the present defect for 1.0.2, the proposed patch looks good enough.
comment:4 by , 11 years ago
Replying to cboos:
The "delete button" you mean?
Hah, yes it was a poorly phrased attempt to say "code that adds the delete button".
I think 1.1.x would be a good target for this. If we want to fix the present defect for 1.0.2, the proposed patch looks good enough.
Okay, sounds good. I'll plan to do the 1.1.x-targeted change in another ticket then.
comment:5 by , 11 years ago
Owner: | set to |
---|---|
Reporter: | changed from | to
Status: | new → assigned |
comment:6 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Given the potential performance penalty, that this change alone wouldn't resolve bh:#427 and isn't general enough to resolve all theme-related issues (as replacing the ITemplateStreamFilter
implementation with JavaScript could do), I'm going to just close this as wontfix. Note also that proposed changes in #10948 reposition the modify / clone / delete buttons.
comment:7 by , 11 years ago
Milestone: | 1.0.2 |
---|
This makes me wonder about the speed implications of this. In Genshi, instead of comparing the ids for h3 elements, we'll compare them for every element. Well, it'll go from slow to slower, so we probably won't notice much.
Still, for how such things should ideally be done IMO, see #10735. In Javascript at least, going to an
#id
is as immediate as it can be…