Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 4846:3e36a3bc0335
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.
| author | Thomas Arendsen Hein <thomas@intevation.de> |
|---|---|
| date | Wed, 13 Nov 2013 11:12:21 +0100 |
| parents | 1e4c45a4254b |
| children | 843886af0ea1 |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Wed Nov 13 09:36:18 2013 +0100 +++ b/roundup/cgi/templating.py Wed Nov 13 11:12:21 2013 +0100 @@ -2048,12 +2048,12 @@ if isinstance(prop, hyperdb.Link): cl = self._db.getclass(prop.classname) labelprop = cl.labelprop() - fn = lambda optionid: cl.get(linkcl.get(optionid, + fn = lambda optionid, propname=propname, labelprop=labelprop: cl.get(linkcl.get(optionid, propname), labelprop) else: - fn = lambda optionid: linkcl.get(optionid, propname) - additional_fns.append(fn) + fn = lambda optionid, propname=propname: linkcl.get(optionid, propname) + additional_fns.append(fn) for optionid in options: # get the option value, and if it's None use an empty string
