Hello all. I updated to the stable release (8.x-1.0), and found that the update breaks my facets' soft-limits. On page load, the soft-limit does not get applied to any facets, causing each facet's full list of options to be shown.
I'm including a patch that resolves the bug for me.
I think the problem is caused by the introduction of facets-views-ajax.js. That file uses jQuery.once()
on the facet <li>
s to apply click handlers. Meanwhile, soft-limit.js was already using .once()
to apply the soft-limit by hiding all the unwanted <li>
s.
Since none of the calls to .once()
specify a key, all of them default to using "once" as their keys. This causes the soft-limit to not be applied at all, because some other JS using the "once" keyword has already run on those elements.
(For more information about .once()
keys, check out the .once()
API documentation.)
Giving the soft-limit a unique keyword seems to fix the problem. See the attached patch.
Comment | File | Size | Author |
---|---|---|---|
facets-broken-soft-limit.patch | 435 bytes | ivavictoria |
Comments
Comment #2
borisson_Should we do this for all of the .once calls we have, as a more general cleanup, or should we do that as a followup? I'm assuming doing that as a followup will be easier.
Comment #4
borisson_We can do this now, and see if we can do others later. Committing this.