From e20b3d17b760f383a2141e93304e517252e95b5d Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Fri, 1 Jun 2018 10:08:03 -0300 Subject: [PATCH] added todo comment --- src/Plugin/Field/FieldFormatter/SolrFacetTextFieldFormatter.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Plugin/Field/FieldFormatter/SolrFacetTextFieldFormatter.php b/src/Plugin/Field/FieldFormatter/SolrFacetTextFieldFormatter.php index a51cc0b..1e542d0 100644 --- a/src/Plugin/Field/FieldFormatter/SolrFacetTextFieldFormatter.php +++ b/src/Plugin/Field/FieldFormatter/SolrFacetTextFieldFormatter.php @@ -6,6 +6,7 @@ use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Url; use Drupal\Core\Link; +use Drupal\search_api_solr\Utility; /** * Plugin implementation of the 'Facet_Field_Formatter' formatter. @@ -42,6 +43,7 @@ class SolrFacetTextFieldFormatter extends FormatterBase { foreach ($items as $delta => $item) { $field = $item->getFieldDefinition(); + // TODO: more robust fieldname parsing $fieldLabel = str_replace(' ', '_', $field->getLabel()); $link = Link::fromTextAndUrl($item->value, Url::fromroute('view.solr_search_content.page_1', [], ['query' => ['f[0]' => $fieldLabel . ':' . $item->value]]));