Skip to content

Commit 74d39a7

Browse files
committed
issue2550822: Fix showing more than one additional property in class menu
Report and patch provided by James Mack: | I had the following option in one of my templates: | tal:content="structure python:context.propname.menu(additional= | ['propname1', 'propname2'])" | | I expected this to display both propname1 and propname2 in the menu. It | only displayed propname2.
1 parent 11d1c94 commit 74d39a7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Fixed:
3939
- executable .py scripts need "#!/usr/bin/env python", add this to demo.py,
4040
remove exec bits from website/wiki/wiki/data/plugin/theme/roundup.py
4141
(Thomas Arendsen Hein)
42+
- issue2550822: Fix showing more than one additional property in class menu
43+
(James Mack)
4244

4345

4446
2013-07-06: 1.5.0

roundup/cgi/templating.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,12 +2048,12 @@ def menu(self, size=None, height=None, showid=0, additional=[], value=None,
20482048
if isinstance(prop, hyperdb.Link):
20492049
cl = self._db.getclass(prop.classname)
20502050
labelprop = cl.labelprop()
2051-
fn = lambda optionid: cl.get(linkcl.get(optionid,
2051+
fn = lambda optionid, propname=propname, labelprop=labelprop: cl.get(linkcl.get(optionid,
20522052
propname),
20532053
labelprop)
20542054
else:
2055-
fn = lambda optionid: linkcl.get(optionid, propname)
2056-
additional_fns.append(fn)
2055+
fn = lambda optionid, propname=propname: linkcl.get(optionid, propname)
2056+
additional_fns.append(fn)
20572057

20582058
for optionid in options:
20592059
# get the option value, and if it's None use an empty string

0 commit comments

Comments
 (0)