Skip to content

Commit 41a19e6

Browse files
author
Richard Jones
committed
fix to multilink form item handling
1 parent 9bc91ac commit 41a19e6

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ are given with the most recent entry first.
33

44
???? 0.4.4?
55
Fixed:
6+
. #596155 ] bug with multilink
67
. #600699 ] documentation in doc/getting_started.txt
78
. #600700 ] doc/upgrading.txt: no info about 0.4.3
89
. #603696 ] Mail followup not inserted

roundup/cgi_client.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.129.2.3 2002-09-02 21:49:04 richard Exp $
18+
# $Id: cgi_client.py,v 1.129.2.4 2002-09-02 21:57:11 richard Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
@@ -1342,13 +1342,16 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
13421342
'value': value, 'classname': link}
13431343
elif isinstance(proptype, hyperdb.Multilink):
13441344
value = form[key]
1345-
if hasattr(value, 'value'):
1346-
# Quite likely to be a FormItem instance
1347-
value = value.value
13481345
if not isinstance(value, type([])):
1346+
if hasattr(value, 'value'):
1347+
value = value.value
13491348
value = [i.strip() for i in value.split(',')]
13501349
else:
1351-
value = [i.strip() for i in value]
1350+
if value and hasattr(value[0], 'value'):
1351+
# an array of (Mini)FieldStorages
1352+
value = [i.value.strip() for i in value]
1353+
else:
1354+
value = [i.strip() for i in value]
13521355
link = cl.properties[key].classname
13531356
l = []
13541357
for entry in map(str, value):
@@ -1382,6 +1385,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
13821385

13831386
#
13841387
# $Log: not supported by cvs2svn $
1388+
# Revision 1.129.2.3 2002/09/02 21:49:04 richard
1389+
# backported fix to CGI form handling from 0.5
1390+
#
13851391
# Revision 1.129.2.2 2002/07/22 22:06:45 richard
13861392
# . #535868 ] Anonymous User Login
13871393
# Hrm, I re-read the intention of the web/email login stuff, and realised

0 commit comments

Comments
 (0)