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

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anybody created an issue. See original summary.

Anybody’s picture

Status: Active » Needs review

Needs manual test & review and the maintainers should decide if to add tests. The MR was written "blind" to first point out the issue.

Anybody’s picture

Added '#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.