diff --git a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php index 353f36f..4d95a26 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php +++ b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php @@ -292,7 +292,7 @@ protected function addNodeRankings(SelectExtender $query) { * {@inheritdoc} */ public function updateIndex() { - $limit = (int) $this->configuration['cron_limit']; + $limit = $this->configuration['cron_limit']; $result = $this->database->queryRange("SELECT DISTINCT n.nid, d.reindex FROM {node} n LEFT JOIN {search_dataset} d ON d.type = :type AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit, array(':type' => $this->getPluginId()), array('target' => 'slave')); $nids = $result->fetchCol(); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php index fe86451..a9c1d95 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php @@ -98,10 +98,12 @@ function setUp() { * Tests for indexing throttle with nodes in multiple languages. */ function testIndexingThrottle() { + $plugin = $this->container->get('plugin.manager.search')->createInstance('node_search'); // Index only 4 items per cron run. - \Drupal::config('search.page.node_search')->set('cron_limit', 4)->save(); + $configuration = $plugin->getConfiguration(); + $configuration['cron_limit'] = 4; + $plugin->setConfiguration($configuration); // Update the index. This does the initial processing. - $plugin = $this->container->get('plugin.manager.search')->createInstance('node_search'); $plugin->updateIndex(); // Run the shutdown function. Testing is a unique case where indexing // and searching has to happen in the same request, so running the shutdown