[facet] ensure a facet DOM id is a valid jQuery identifier. Closes #2789089 oldstable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 03 Apr 2013 10:51:15 +0200
brancholdstable
changeset 8859 6ed22ac7257c
parent 8858 51fdbbbd07b2
child 8860 e5db11a399be
[facet] ensure a facet DOM id is a valid jQuery identifier. Closes #2789089
web/facet.py
--- a/web/facet.py	Mon Feb 04 14:39:55 2013 +0100
+++ b/web/facet.py	Wed Apr 03 10:51:15 2013 +0200
@@ -65,7 +65,7 @@
 
 from cubicweb import Unauthorized, typed_eid
 from cubicweb.schema import display_name
-from cubicweb.uilib import css_em_num_value
+from cubicweb.uilib import css_em_num_value, domid
 from cubicweb.utils import make_uid
 from cubicweb.predicates import match_context_prop, partial_relation_possible
 from cubicweb.appobject import AppObject
@@ -1449,7 +1449,7 @@
     def _render(self):
         w = self.w
         title = xml_escape(self.facet.title)
-        facetid = make_uid(self.facet.__regid__)
+        facetid = domid(make_uid(self.facet.__regid__))
         w(u'<div id="%s" class="facet">\n' % facetid)
         cssclass = 'facetTitle'
         if self.facet.allow_hide: