Facet not rendered if slider step is decimal

Created on 26 August 2023, 10 months ago
Updated 8 November 2023, 8 months 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 8 months 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.69.0 2024