Code

Allow value to be specified to multilink form element templating
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Mon, 1 Feb 2010 04:54:59 +0000 (04:54 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Mon, 1 Feb 2010 04:54:59 +0000 (04:54 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4443 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
roundup/cgi/templating.py

index e311524ab9914681496739b5d2e014c01edb560d..7161378a5cbb50cb54d4d3c6fc043cefd10a9ed0 100644 (file)
@@ -27,6 +27,8 @@ Fixes:
   fixes issue1675845
 - Attempt to generate more human-readable addresses in email, fixes
   issue2550632
+- Allow value to be specified to multilink form element templating, fixes
+  issue2550613, thanks David Wolever
 
 
 2009-12-21 1.4.11 (r4413)
index ff354da48a38aba839a93f4c093135ee2748b338..2e090416ad08174e4476fa06f1f825a4cb4a4275 100644 (file)
@@ -2154,16 +2154,18 @@ class MultilinkHTMLProperty(HTMLProperty):
             return self.plain(escape=1)
 
         linkcl = self._db.getclass(self._prop.classname)
-        value = self._value[:]
-        # map the id to the label property
-        if not linkcl.getkey():
-            showid=1
-        if not showid:
-            k = linkcl.labelprop(1)
-            value = lookupKeys(linkcl, k, value)
-        value = ','.join(value)
-        return self.input(name=self._formname, size=size, value=value,
-                          **kwargs)
+
+        if 'value' not in kwargs:
+            value = self._value[:]
+            # map the id to the label property
+            if not linkcl.getkey():
+                showid=1
+            if not showid:
+                k = linkcl.labelprop(1)
+                value = lookupKeys(linkcl, k, value)
+            value = ','.join(value)
+
+        return self.input(name=self._formname, size=size, **kwargs)
 
     def menu(self, size=None, height=None, showid=0, additional=[],
              value=None, sort_on=None, html_kwargs = {}, **conditions):