Re: The old "@file" form value does not induce @link@files=file-1 ?
"John P. Rouillard" <[email protected]> Wed, 27 Dec 2023 10:14:56 -0500
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Gabor:
In message <20231227153507.1b87c45e@Dell>,
Nagy Gabor writes:
>I wanted to use the "@file" form variable (which is kept for backward
>compatibility), because its support for multiple files would be handy
>for my use case.
>
>The documentation says that
>"@file
> This is equivalent to::
>
> @link@files=file-1
> file-1@content=value"
>
>On my system, it does not do @link@files=file-1...
What does your HTML input look like? I have a current development
classic tacker deployed and using the file input defined with:
<input type="file" name="@file" size="40">
works as expected.
>I've also tried with the default classic theme (issue.item.html uses
>@file), with the same result: The uploaded file is not added to the
>files list of the issue; I've tried with both empty and non-empty
>messages.
I can't reproduce this.
>Well, I am using a slightly patched roundup version v2.1.0, but I did
>not touch cgi/form_parser.py (and as I see that file did not change
>between 2.1.0 and 2.2.0). Could you please give a look on your system
>to this? And I would be also grateful for a supposed fix / patch :)
A few questions:
1) is the file created and is it viewable at the /fileNN endpoint?
2) what does your schema for issues looks like?
3) what does the files property for the issue look like in
roundup-admin when you use 'display issue#'
From a quick glance at the code I don't see anything out of place. The
code is a bit different from handling @note, and all the special
variable handling is split into multiple parts making tracing it
tough, but it looks like:
all_links.append((cn, nodeid, 'files',
[('file', fnodeid)]))
does get set properly and that should result in appending the new file
to the files property.
>[I've already implemented some new features assuming that this works as
>expected... I even copied an other FileClass() to the class file to use
>this feature. I should have been tested it first. :]
Note that @file will link only for the files property of an
IssueClass. It won't work for anything else. It looks like it should
throw an error when used in another context, but I can't be sure about
that.
--
-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.