Roundup Tracker - Issues

Message5912

Author rouilj
Recipients rouilj
Date 2016-10-21.01:37:56
Message-id <1477013878.63.0.281464580582.issue2550929@psf.upfronthosting.co.za>
In-reply-to
I emailed Ralf a couple of times, but I haven't heard back from him. I
hope somebody else may know what the problem was that he was fixing.

In my issue.item.html page, I have a field:

    msg-1@messagetype

that is set by default. When the form is committed, there is a form
element

  ('msg', '-1'): {'messagetype': '1'}

If there is only a property change (e.g. add a new user to the nosy
list, or set the status...) that does not include a change note, the error:

  Edit Error: 'content'

is displayed.

I bisected the code to figure out what changed and it looks like
cc4f4ee46d88 makes my form fail.

The diff for cc4f4ee46d88 is:

  diff -r 71643a839c80 -r cc4f4ee46d88 roundup/cgi/form_parser.py
  --- a/roundup/cgi/form_parser.py        Thu Jul 14 22:03:48 2016 -0400
  +++ b/roundup/cgi/form_parser.py        Mon Jul 18 13:21:43 2016 +0200
  @@ -594,11 +594,9 @@
                   # new item (any class) with no content - ignore
                   del all_props[(cn, id)]
               elif isinstance(self.db.classes[cn], hyperdb.FileClass):
  -                if id is not None and id.startswith('-'):
  -                    if not props.get('content', ''):
  -                        del all_props[(cn, id)]
  -                elif props.has_key('content') and not props['content']:
  -                    raise FormError (self._('File is empty'))
  +                # Avoid emptying the file
  +                if props.has_key('content') and not props['content']:
  +                    del props ['content']
           return all_props, all_links

       def parse_file(self, fpropdef, fprops, v):

with the checkin comment of:

   Fix file attribute parsing

   Fix bug introduced when allowing multiple file attachments.

With the original code (prefixed by -), the "msg -1" tuple in the form
is removed because "msg -1" has no content property in the form. This
I claim is correct operation in my case.

With the new code, the "msg -1" property is passed through and
something goes boom later on in the code.

I am not quite sure what the failure was in the multiple file case.

Reverting cc4f4ee46d88, I can upload 1 or 3 files at once using a
"input type=file multiple" field. I don't have any empty files after
the upload.

I am tempted to just revert the change unless somebody can tell me
what this patch was supposed to fix so I can reproduce the original
problem and try to fix it.

Comments?

-- rouilj
History
Date User Action Args
2016-10-21 01:37:58rouiljsetrecipients: + rouilj
2016-10-21 01:37:58rouiljsetmessageid: <1477013878.63.0.281464580582.issue2550929@psf.upfronthosting.co.za>
2016-10-21 01:37:58rouiljlinkissue2550929 messages
2016-10-21 01:37:56rouiljcreate