diff --git a/src/Plugin/views/filter/SearchApiFulltext.php b/src/Plugin/views/filter/SearchApiFulltext.php index f76c381..72d065f 100644 --- a/src/Plugin/views/filter/SearchApiFulltext.php +++ b/src/Plugin/views/filter/SearchApiFulltext.php @@ -233,9 +233,10 @@ class SearchApiFulltext extends SearchApiFilterText { */ protected function getFulltextFields() { $fields = array(); + /** @var \Drupal\search_api\IndexInterface $index */ $index = Index::load(substr($this->table, 17)); - $fields_info = $index->getFields(); + $fields_info = $index->getCachedFields(); foreach ($index->getFulltextFields() as $field_id) { $fields[$field_id] = $fields_info[$field_id]->getPrefixedLabel(); } diff --git a/tests/src/Unit/Plugin/Processor/AggregatedFieldTest.php b/tests/src/Unit/Plugin/Processor/AggregatedFieldTest.php index 0cc675b..085e541 100644 --- a/tests/src/Unit/Plugin/Processor/AggregatedFieldTest.php +++ b/tests/src/Unit/Plugin/Processor/AggregatedFieldTest.php @@ -441,7 +441,7 @@ class AggregatedFieldTest extends UnitTestCase { $index_fields[$field_id] = $field_object; } $this->index->expects($this->any()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue($index_fields)); $configuration['fields'] = array( diff --git a/tests/src/Unit/Plugin/Processor/FieldsProcessorPluginBaseTest.php b/tests/src/Unit/Plugin/Processor/FieldsProcessorPluginBaseTest.php index cd3fd8b..1fd7df6 100644 --- a/tests/src/Unit/Plugin/Processor/FieldsProcessorPluginBaseTest.php +++ b/tests/src/Unit/Plugin/Processor/FieldsProcessorPluginBaseTest.php @@ -50,7 +50,7 @@ class FieldsProcessorPluginBaseTest extends UnitTestCase { ->will($this->returnValue(TRUE)); $fields = $this->getTestItem()[$this->itemIds[0]]->getFields(); $this->index->expects($this->any()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue($fields)); $this->processor = new TestFieldsProcessorPlugin(array('index' => $this->index), '', array()); diff --git a/tests/src/Unit/Plugin/Processor/HighlightTest.php b/tests/src/Unit/Plugin/Processor/HighlightTest.php index 2cc02fa..b2fe480 100644 --- a/tests/src/Unit/Plugin/Processor/HighlightTest.php +++ b/tests/src/Unit/Plugin/Processor/HighlightTest.php @@ -119,7 +119,7 @@ class HighlightTest extends UnitTestCase { $field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $field))); $this->processor->setIndex($index); @@ -165,7 +165,7 @@ class HighlightTest extends UnitTestCase { $field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $field))); $this->processor->setIndex($index); @@ -211,7 +211,7 @@ class HighlightTest extends UnitTestCase { $field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $field))); $this->processor->setIndex($index); @@ -255,7 +255,7 @@ class HighlightTest extends UnitTestCase { $field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $field))); $this->processor->setIndex($index); @@ -304,7 +304,7 @@ class HighlightTest extends UnitTestCase { $field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $field))); $this->processor->setIndex($index); @@ -350,7 +350,7 @@ class HighlightTest extends UnitTestCase { $field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $field))); $this->processor->setIndex($index); @@ -398,7 +398,7 @@ class HighlightTest extends UnitTestCase { $field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $field))); $this->processor->setIndex($index); @@ -446,7 +446,7 @@ class HighlightTest extends UnitTestCase { $field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $field))); $this->processor->setIndex($index); @@ -506,7 +506,7 @@ class HighlightTest extends UnitTestCase { $body_field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $body_field))); $this->processor->setIndex($index); @@ -556,7 +556,7 @@ class HighlightTest extends UnitTestCase { $title_field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $body_field, $title_field_id => $title_field))); $this->processor->setIndex($index); @@ -610,7 +610,7 @@ class HighlightTest extends UnitTestCase { $body_field->setType('text'); $index->expects($this->atLeastOnce()) - ->method('getFields') + ->method('getCachedFields') ->will($this->returnValue(array($body_field_id => $body_field))); $this->processor->setIndex($index);