#4086 closed defect (fixed)
Attachment not found, Macro not evaluated
Reported by: | Owned by: | Martin Scharrer | |
---|---|---|---|
Priority: | normal | Component: | AttachmentNumMacro |
Severity: | blocker | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Hi there,
when I put this in my custom field of the ticket (which accepts Wiki-formatting, e.g. [raw-attachment:file.pdf] works without problems] I get the result displayed as [[AttachmentNum(...)]. When I put it in the description field I get a "Attachment not found" error, although there is an attachment. When I let it display the type and ID used in the SQL query the type is ticket, which seems ok, but the ID is "Ticket #8", which is probably not ok, most likely this should be just "8"?
Sorry, I would fix this myself, but I have no clue about python neither about the necessary functions in trac (get_resource_id maybe?)
Thanks and best, ALEXander.
Attachments (0)
Change History (11)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Owner: | changed from Martin Scharrer to anonymous |
---|---|
Status: | new → assigned |
By sure to end the macro with two ]], you only have one here.
I had to look for the proper functions to get the resource ID two and tested it only with wiki pages. I have to look into this, but I don't have time until the week end.
comment:3 Changed 16 years ago by
Owner: | changed from anonymous to Martin Scharrer |
---|---|
Status: | assigned → new |
Wasn't logged in :-)
comment:4 Changed 16 years ago by
Status: | new → assigned |
---|
comment:5 Changed 16 years ago by
Yeah, I used to brackets, just a mistake in the description. No worries about taking your time, it's not at all urgent.
comment:6 Changed 16 years ago by
I found the fix for the ID right away. Try the new revision which works with tickets on my trac.
I can't do much about the non-evaluation from here. Can you try if other macros (not wiki links) work there or not. What kind of custom field do you use? This error might be a bug in the custom field implementation not this macro.
comment:7 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Yeah, now it shows in the wiki. I applied changeset [7563] to version 0.11.1 to get WikiFormatting into custom fields (I use text). But the image macro also does not work there, seems to be an issue with the patch. Well.... I think now I will wait for 0.12.
comment:8 Changed 16 years ago by
I checked and it seems that wiki_to_oneliner(), which is used to evaluate the WikiFormatting in the query display (source:/trunk/trac/ticket/templates/query_results.html@7563#65) does not evaluate macros. I changed it to wiki_to_html, but then <p> and </p> tags are inserted, which make the list twice as long. I think I will stop now and go to bed :)
comment:9 Changed 16 years ago by
comment:10 Changed 16 years ago by
AFIK the wiki_to_...
functions are deprecated anyway. Use the format_to_onliner
function there, which should expand macros. Try to test it with some other macro instead of the Image
macro ... its code isn't really my favorite.
BTW, you can just add trac:
in front of source:
links to point to trac.edgewall.org, i.e. trac:source:/trunk/trac/ticket/templates/query_results.html@7563#65
The last part of the first sentence should read "I get the result displayed as ![[AttachmentNum?(...)]. "