Message742
Logged In: YES
user_id=707416
Hmm, I don't believe Allen's patch is quite right as it assumes that there is
always a message that is created.
With the current cvs version, it
is possible to have no body
text and still have an attachment. In which
case, the file
hyperdb item is created, but there is no link to it
anywhere
since no message was created.
I think the code in
mailgw.py that reads:
#
# handle the attachments
#
files = []
for (name, mime_type, data) in attachments:
if not
name:
name = "unnamed"
files.append(self.db.file.create(type=mime_type, name=name,
content=data, **file_props))
Needs to have something
like:
if nodeid:
# add the files to the node's list
fileprop =
cl.get(nodeid, 'file')
fileprop.append(files)
props['files'] =
fileprop
else:
# pre-load the files list
props['file'] =
files
appended to it. But I am not quite sure this is right
either.
In any case with the current cvs code, you can use the
following shell script to add the files in the linked messages to the issue's
files link.
for issue in `roundup-admin -s -i /var/roundup/admin list
issue`
do
echo 'Running over issue $issue'
files=""
for
msg in `roundup-admin -s -i /var/roundup/admin get messages
issue$issue`
do
echo "Scanning message $msg"
files="$files,`roundup-admin -c -i /var/roundup/admin get files
msg$msg`"
done
[ -z "$files" ] && \
roundup-admin -s -i
/var/roundup/admin set issue$issue \
messages=`echo $files | sed -
e 's/,,//g'`
done
This will take a while, but it runs over all issues
making sure to set the files field of the issue to the union of the files fields for
all the issues messages. Note this will work ONLY with the current cvs
0.6.0 tracker as it needs my mods to run.
Also replace the tracker
/var/roundup/admin with the path to your tracker.
Sorry for
putting the script inline, but I can't upload any files to this bug report even
though I am logged in 8-(.
-- rouilj |
|
Date |
User |
Action |
Args |
2009-02-03 14:20:19 | admin | link | issue711501 messages |
2009-02-03 14:20:19 | admin | create | |
|