- ๐บ๐ธUnited States smustgrave
So this appears to be an issue in core but maybe this module could fix in the meantime.
- Status changed to Needs review
8 months ago 9:53pm 15 April 2024 - ๐ฎ๐ณIndia siddharthjain
Hi there,
I have reviewed the above MR with the below steps performed:
- Added a exposed filter using Number type field
- Added Number filter plugin in BEF and added min and max values
Here the outcomes:
- The Number filter plugin gets added
- After saving the BEF settings the min and max values are not getting saved.
We can update the default value for min and max fields to look like this:
'#default_value' => !empty($this->configuration['min']) ? $this->configuration['min'] : '',
Other than this the Number filter plugin works smoothly, thanks for the functionality.
- ๐บ๐ธUnited States bernardm28 Tennessee
I tested this using drupalpod 10.1.x with demo_umami.
It looks to me like the min-max values are being saved but the plugin is not reading values that are already stored in config.
Even after you enter min 3 and max 30 and verify it works the form will load with empty values.I used the /en/recipes view with the exposed filter of (field_cooking_time)
The up arrow seems to work well. I was able to increase the values with it and the min and max work as expected on the expose form but the plugin did not seem to read previously saved values.
Because it does not load the previously saved min max values on the config form it probably needs to go back to needs work.
- Status changed to Needs work
8 months ago 3:02am 17 April 2024 - ๐บ๐ธUnited States smustgrave
Not sure I follow reading the saved forms. The min/max sets the attributes on the input. So nothing will load but html validation will prevent the form submission if the values are outside that.
- ๐บ๐ธUnited States bernardm28 Tennessee
The image above is an example of what I would expect if I set the minimum and maximum values and go back into the config form. I would expect those values to load from the save config and allow me to change them again. Unfortunately, the form values will be empty no matter what.
The exposed filter worked as expected but the config form values for min and max was empty.
I modified Number.php to match what is used in NumericItemBase.php.
It should be working as expected now.
- Status changed to Needs review
8 months ago 3:51am 17 April 2024 - Status changed to RTBC
8 months ago 1:18am 18 April 2024 - ๐บ๐ธUnited States kwiseman
I tested the Number filter in Drupalpod 10.1.x with the Umami demo after the last 2 commits by adding an exposed filter for number of servings to the Recipes view, and it works as expected. I wasn't sure if it mattered that the default values for min and max were empty strings (on lines 36 and 37 of src/Plugin/better_exposed_filters/filter/Number.php), so I tried setting them both back to NULL, and it still worked as expected.
- Status changed to Needs work
8 months ago 1:22am 18 April 2024 - ๐บ๐ธUnited States smustgrave
Believe the min and max should probably remain NULL but definitely donโt think empty string. If these values arenโt set the attributes shouldnโt appear.
Also string donโt think matches the schema we are adding
- Status changed to RTBC
8 months ago 1:37am 18 April 2024 - ๐บ๐ธUnited States smustgrave
Saving credit.
Will merge tomorrow, plan a release Friday
-
smustgrave โ
committed fac114fc on 6.0.x
Resolve #3267495 "Add support for"
-
smustgrave โ
committed fac114fc on 6.0.x
- Status changed to Fixed
8 months ago 2:10pm 19 April 2024 - ๐ฉ๐ชGermany tobiasb Berlin
FullyValidatable as a constraint is not valid for Drupal core < 10.3. See CR https://www.drupal.org/node/3404425.
So I would just leave as a todo.
Automatically closed - issue fixed for 2 weeks with no activity.