Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In FacetForm.php there are several cases where '#type' => 'number',
is used in combination with #maxlength
which doesn't seem to be implemented.
See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...
For example:
$form['facet_settings']['weight'] = [
'#type' => 'number',
'#title' => $this->t('Weight'),
'#default_value' => $facet->getWeight(),
'#description' => $this->t('This weight is used to determine the order of the facets in the URL if pretty paths are used.'),
'#maxlength' => 4,
'#required' => TRUE,
];
Steps to reproduce
Proposed resolution
Use
#max
and / or #size
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork facets-3273431
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
AnybodyNeeds manual test & review and the maintainers should decide if to add tests. The MR was written "blind" to first point out the issue.
Comment #4
AnybodyAdded
'#min' => 0
to min_count as #2993101: Display facets when there are no search results is likely not to be committed, which contained that change.