cubicweb #4502768 foldable "has_text" facet breaks entire facet JS operations [validation pending]

If facetbase.FacetStringWidget is monkeypatched to support the allow_hide facet parameter, the entire facet fails with the following traceback:

2014-10-20 11:42:09 - (cubicweb.appobject) ERROR: while computing values for <ManifCategoryFacet on (in_category-subject)>
Traceback (most recent call last):
  File "/home/rcardona/Projects/grshell-breton/cubicweb/web/facet.py", line 674, in possible_values
    values = [unicode(x) for x, in self.rqlexec(select.as_string())]
  File "/home/rcardona/Projects/grshell-breton/cubicweb/web/facet.py", line 473, in rqlexec
    return self._cw.execute(rql, args)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/web/request.py", line 1066, in execute
    rset = self.cnx.execute(*args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/repoapi.py", line 129, in check_open
    return func(clt_cnx, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/repoapi.py", line 213, in execute
    rset = self._cnx.execute(*args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/session.py", line 371, in wrapper
    return func(cnx, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/session.py", line 381, in check_open
    return func(cnx, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/session.py", line 1022, in execute
    rset = self._execute(self, rql, kwargs, build_descr)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/querier.py", line 593, in execute
    results = plan.execute()
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/querier.py", line 177, in execute
    result = step.execute()
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/ssplanner.py", line 374, in execute
    result = source.syntax_tree_search(cnx, union, args, cachekey, inputmap)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/native.py", line 533, in syntax_tree_search
    sql, qargs, cbs = self._rql_sqlgen.generate(union, args, varmap)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 732, in generate
    sql = self.union_sql(union)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 740, in union_sql
    return self.select_sql(union.children[0], needalias)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 834, in select_sql
    needalias or needwrap)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 910, in _solutions_sql
    self._state.add_restriction(select.where.accept(self))
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 961, in visit_and
    part = c.accept(self)
  File "/home/rcardona/Projects/grshell-breton/rql/utils.py", line 166, in accept
    return visit_method(self, *args, **kwargs)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 1032, in visit_relation
    sql = self._visit_has_text_relation(relation)
  File "/home/rcardona/Projects/grshell-breton/cubicweb/server/sources/rql2sql.py", line 1386, in _visit_has_text_relation
    query = const.eval(self._args)
AttributeError: 'Function' object has no attribute 'eval'

It appears that facetFormContent selects the text facet's hidden input twice: once in the intended section, and in the input:hidden section.

prioritynormal
typebug
done in3.19.6
load0.500
load left0.000
closed by#832a2a0b7bd2 [facets] Correctly look for inputs of type "hidden" (closes #4502768)
patch[facets] Correctly look for inputs of type "hidden" (closes #4502768) [applied]