[facets] Correctly look for inputs of type "hidden" (closes #4502768)
jQuery ':hidden' selector looks at CSS visual properties (eg, 'display',
'visibility'). The intent here was probably to look for inputs of type
"hidden", which many facets use to store user selection data (eg,
FacetRangeWidget).
The problem is that regular text inputs (eg the "has_text" facet which
has a '<input type="text"/>') will be picked up by this selector if they
are inside a folded facet. Chaos and destruction ensue.
--- a/web/data/cubicweb.facets.js Wed Oct 15 18:23:54 2014 +0200
+++ b/web/data/cubicweb.facets.js Mon Oct 20 12:23:13 2014 +0200
@@ -35,7 +35,7 @@
});
// pick up hidden inputs (required metadata inputs such as 'facets'
// but also RangeWidgets)
- $form.find('input:hidden').each(function() {
+ $form.find('input[type="hidden"]').each(function() {
names.push(this.name);
values.push(this.value);
});