[urlpublishing] handle sub-types in RestPathEvaluator
Since commit 31a1813d53f3 "[entity/url publishing] fetch_rqlst should
use 'is_instance_of' instead of 'is'", the RestPathEvaluator's input
rset can have more than one etype, so it can't always use sameetypelist.
Related to #3825488
--- a/web/views/urlpublishing.py Mon Nov 24 14:43:28 2014 +0100
+++ b/web/views/urlpublishing.py Mon Nov 24 17:43:29 2014 +0100
@@ -209,7 +209,10 @@
if rset.rowcount == 1:
req.form.setdefault('vid', 'primary')
else: # rset.rowcount >= 1
- req.form.setdefault('vid', 'sameetypelist')
+ if len(rset.column_types(0)) > 1:
+ req.form.setdefault('vid', 'list')
+ else:
+ req.form.setdefault('vid', 'sameetypelist')
def handle_etype(self, req, cls):
rset = req.execute(cls.fetch_rql(req.user))