#12479 closed defect (fixed)
Trac 1.2 incompatibility
Reported by: | sdegrande | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | DownloadsPlugin |
Severity: | normal | Keywords: | |
Cc: | Ryan J Ollos | Trac Release: | 1.2 |
Description
Please find attached a quick patch to have this plugin work with Trac 1.2 (python 2.7).
Thanks for your work.
Attachments (1)
Change History (12)
Changed 9 years ago by
Attachment: | fix_1.2_compat.diff added |
---|
comment:1 Changed 9 years ago by
Status: | new → accepted |
---|
comment:2 Changed 9 years ago by
comment:3 follow-up: 4 Changed 9 years ago by
(Sorry, I forgot to clean the patch before to send it...)
DownloadsCore as well as DownloadsDownloads implement IRequestHandler.
Those two components catch the same regexp to react to a file download request. The two set an 'action' flag to 'get-file'. And the two set a context's realm ("downloads-core" for the first, "downloads-downloads" for the second).
In api.py:_get_modes(), the 'get-file' action is only checked if the realm is 'downloads-core'. It means that the file gets downloaded only if DownloadsCore handles the request.
It was working before Trac 1.2, but does no more work now (when you click on a file link to download it, nothing happens).
My guess is that Trac 1.2 introduced a change in the order of execution of RequestHandlers: in Trac 1.1, DownloadsCore was called first, but in Trac 1.2 DownloadsDownloads is called first.
Well, just a guess...
I do not know what was the initial idea of the author, and I chose to use DownloadsDownloads to handle all the requests.
Note that the 'elif context.resource.realm == 'downloads-core': ....' alternative in api.py:_get_modes() is also to be removed...
Worth sending you a clean version of the patch ? (My initial intention was not to submit a patch ready to be committed, but rather some 'indication' on how to fix the issue. Sorry about that !!!)
comment:4 Changed 9 years ago by
Replying to sdegrande:
It was working before Trac 1.2, but does no more work now (when you click on a file link to download it, nothing happens).
My guess is that Trac 1.2 introduced a change in the order of execution of RequestHandlers: in Trac 1.1, DownloadsCore was called first, but in Trac 1.2 DownloadsDownloads is called first.
The ordering might have changed due to [trac 12922#file7]. The IRequestHandler
s are stored in dict.
Worth sending you a clean version of the patch ? (My initial intention was not to submit a patch ready to be committed, but rather some 'indication' on how to fix the issue. Sorry about that !!!)
Yeah, feel free to rework the patch and post for review, or just commit yourself. We can review things after they are committed, but it's nice to have a clean commit history by reviewing first.
comment:5 Changed 9 years ago by
Owner: | changed from Ryan J Ollos to sdegrande |
---|---|
Status: | accepted → assigned |
comment:7 Changed 8 years ago by
Owner: | changed from sdegrande to Ryan J Ollos |
---|---|
Status: | assigned → accepted |
comment:9 Changed 8 years ago by
@sdegrande: Please test if you can, and report back whether the changes are working well for you.
I haven't tested the patch yet. Could you provided some details on the commented
IRequestHandler
implementation intracdownloads/core.py
?