diff roundup/cgi/templating.py @ 5184:a40ea636a2ad

Issue2550934 - templating.py-indexargs_form() returns id's as space separated list not comma separated Compare filter=id&id=1+2+3+4+5+6+7 (+ means space) to filter=id&id=1,2,3,4,5,6,7 the latter seems to be a valid filter and the index page search will return items with those 7 id's. The former does not return the expected 7 items. Check to see if the name of the field is id. If it is don't treat it as a string which pastes all the values together with spaces.
author John Rouillard <rouilj@ieee.org>
date Fri, 17 Feb 2017 19:33:01 -0500
parents 5c8808f55d93
children 89b1870b1bc9
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Sat Feb 11 17:25:05 2017 -0500
+++ b/roundup/cgi/templating.py	Fri Feb 17 19:33:01 2017 -0500
@@ -2763,7 +2763,10 @@
                 if k in exclude:
                     continue
                 if type(v) == type([]):
-                    if isinstance(cls.get_transitive_prop(k), hyperdb.String):
+                    # id's are stored as strings but should be treated
+                    # as integers in lists.
+                    if (isinstance(cls.get_transitive_prop(k), hyperdb.String)
+                        and k != 'id'):
                         add(k, ' '.join(v))
                     else:
                         add(k, ','.join(v))

Roundup Issue Tracker: http://roundup-tracker.org/