Fix handling of limit within the primary view for related elements. Closes #4723579
* respect limit set by uicfg (like the 'autolimited' view itself does)
* set limit in rql query to one more than the specified one so the view knows
there are more things to display
--- a/web/views/primary.py Mon Dec 29 12:35:34 2014 +0100
+++ b/web/views/primary.py Thu Dec 04 11:37:10 2014 +0100
@@ -237,7 +237,9 @@
rtype=rschema.type, role=role)
else:
vid = dispctrl.get('vid', 'autolimited')
- limit = defaultlimit if vid == 'autolimited' else None
+ limit = dispctrl.get('limit', defaultlimit) if vid == 'autolimited' else None
+ if limit is not None:
+ limit += 1 # need one more so the view can check if there is more than the limit
rset = self._relation_rset(entity, rschema, role, dispctrl, limit=limit)
if not rset:
continue