Facet not rendered if slider step is decimal

Created on 26 August 2023, over 1 year ago
Updated 8 November 2023, over 1 year ago

Problem/Motivation

I have a field indexed as decimal with a facet using Facets Range Dropdown. The facet dropdown renders ok with slider step=1 but is missing the granularity desired, e.g. 1, 2, 3 is showing instead of 1, 1.25, 1.5, 1.75, 2, etc. If I change the slider step to be 0.25, or .5 no facet is rendered at all.

🐛 Bug report
Status

Needs review

Component

Code

Created by

🇳🇿New Zealand jonathan_hunt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jonathan_hunt
  • Status changed to Needs review over 1 year ago
  • 🇳🇱Netherlands ricovandevin

    @johathan_hunt This was probably causes by the fact that the modulo calculation in \Drupal\facets_range_dropdowns\Plugin\facets\processor\RangeProcessor::getMinMax() was not working for for floating point step sizes that give a 0 when converted to integer (which then leads to a division by zero error). In 🐛 Count only includes results that exactly match the value Active the simple module calculation (%) has been replaced with floating point module calculation (fmod()). I expect that to fix this issue too. Can you confirm?

Production build 0.71.5 2024