[issue2550929] Edit Error: 'content' after commit cc4f4ee46d88

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

[issue2550929] Edit Error: 'content' after commit cc4f4ee46d88

John Rouillard

New submission from John Rouillard:

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:


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

  ('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.


-- rouilj

assignee: rouilj
components: Web interface
messages: 5912
nosy: rouilj
priority: high
severity: major
status: new
title: Edit Error: 'content' after commit cc4f4ee46d88
type: behavior

Roundup tracker <[hidden email]>

Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Roundup-devel mailing list
[hidden email]