Skip to content

Commit b96c661

Browse files
committed
issue2551413 - Broken MultiLink columns in CSV export
cmeerw found a crash and bug. While investigating CSV export using names with a multilink field that doesn't have a label field (name or realname for user class). cmeerw's patch displays a multilink like messages as "['12', '23']" as when exporting csv with id. I changes code so this displays as "12;23" to match the list format output of the other fields in export csv (with names).
1 parent 0c60ec8 commit b96c661

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Fixed:
3737
script. Found/patch by Norbert Schlemmer. (John Rouillard)
3838
- change some internal classes to use __slots__ for hopefully a small
3939
performance improvement. (John Rouillard)
40+
- issue2551413 - Broken MultiLink columns in CSV export. CSV export of
41+
a multilink link "messages" that does not have a 'name' property
42+
causes a crash. (found/fix by cmeerw; commit and better handling of
43+
non-labeled multilink by John Rouillard)
4044

4145
Features:
4246

roundup/cgi/actions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,14 +1688,17 @@ def fct(arg):
16881688
if isinstance(props[col], hyperdb.Multilink):
16891689
cname = props[col].classname
16901690
cclass = self.db.getclass(cname)
1691-
represent[col] = repr_list(cclass, 'name')
16921691
if not self.hasPermission(self.permissionType, classname=cname):
16931692
represent[col] = repr_no_right(cclass, 'name')
16941693
else:
16951694
if 'name' in cclass.getprops():
16961695
represent[col] = repr_list(cclass, 'name')
16971696
elif cname == 'user':
16981697
represent[col] = repr_list(cclass, 'realname')
1698+
else:
1699+
# handle cases like messages which have no
1700+
# useful label field issue2551413
1701+
represent[col] = repr_list(cclass, 'id')
16991702
if isinstance(props[col], hyperdb.Link):
17001703
cname = props[col].classname
17011704
cclass = self.db.getclass(cname)

0 commit comments

Comments
 (0)