Commit bceb4835 authored by Markus Kalkbrenner's avatar Markus Kalkbrenner Committed by Markus Kalkbrenner
Browse files

Issue #3279221 by Upchuk, mkalkbrenner: Facet form broken for non-Search API facet sources

parent 09925ee5
Loading
Loading
Loading
Loading
+22 −23
Original line number Diff line number Diff line
@@ -465,17 +465,17 @@ class FacetForm extends EntityForm {
      '#title' => $this->t('Use hierarchy'),
      '#default_value' => $facet->getUseHierarchy(),
    ];
    if (!$facet->getFacetSource() instanceof SearchApiDisplay) {
      $form['facet_settings']['use_hierarchy']['#disabled'] = TRUE;
      $form['facet_settings']['use_hierarchy']['#description'] = $this->t('This setting only works with Search API based facets.');
    }
    else {
    if ($facet->getFacetSource() instanceof SearchApiDisplay) {
      $processor_url = Url::fromRoute('entity.search_api_index.processors', [
        'search_api_index' => $facet->getFacetSource()->getIndex()->id(),
      ]);
      $description = $this->t('Renders the items using hierarchy. Make sure to enable the hierarchy processor on the <a href=":processor-url">Search api index processor configuration</a> for this to work as expected. If disabled all items will be flattened.', [
      $description = $this->t('Renders the items using hierarchy. Depending on the selected plugin below, make sure to enable the hierarchy processor on the <a href=":processor-url">Search api index processor configuration</a> for this to work as expected. If disabled all items might be flattened.', [
        ':processor-url' => $processor_url->toString(),
      ]);
    }
    else {
      $description = $this->t('Renders the items using hierarchy. Note that some of the selectable plugins below will not supports all search backends. The taxonomy plugin will only work with Search API.');
    }
    $form['facet_settings']['use_hierarchy']['#description'] = $description;

    $hierarchy = $facet->getHierarchy();
@@ -493,7 +493,6 @@ class FacetForm extends EntityForm {
        ],
      ],
    ];
    }

    $form['facet_settings']['keep_hierarchy_parents_active'] = [
      '#type' => 'checkbox',