diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc index ae0ea48..6dfcae6 100644 --- a/core/modules/locale/locale.batch.inc +++ b/core/modules/locale/locale.batch.inc @@ -238,7 +238,7 @@ function locale_translation_http_check($uri) { $result['location'] = $response->getEffectiveUrl(); } - $result['last_modified'] = $response->getLastModified() ? strtotime($response->getLastModified()) : 0; + $result['last_modified'] = $response->hasHeader('Last-Modified') ? strtotime($response->getHeader('Last-Modified')) : 0; return $result; } catch (RequestException $e) { diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php index d6dfbab..ad68b72 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php @@ -86,16 +86,16 @@ function testStatisticsSettings() { $post = array('nid' => $nid); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $this->client->post($stats_path, array(), $post); + $this->client->post($stats_path, array('body' => $post)); // Hit the node again (the counter is incremented after the hit, so // "1 view" will actually be shown when the node is hit the second time). $this->drupalGet('node/' . $this->test_node->id()); - $this->client->post($stats_path, array(), $post); + $this->client->post($stats_path, array('body' => $post)); $this->assertText('1 view', 'Node is viewed once.'); $this->drupalGet('node/' . $this->test_node->id()); - $this->client->post($stats_path, array(), $post); + $this->client->post($stats_path, array('body' => $post)); $this->assertText('2 views', 'Node is viewed 2 times.'); } @@ -111,7 +111,7 @@ function testDeleteNode() { $post = array('nid' => $nid); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $this->client->post($stats_path, array(), $post); + $this->client->post($stats_path, array('body' => $post)); $result = db_select('node_counter', 'n') ->fields('n', array('nid')) @@ -145,9 +145,9 @@ function testExpiredLogs() { $post = array('nid' => $nid); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $this->client->post($stats_path, array(), $post); + $this->client->post($stats_path, array('body' => $post)); $this->drupalGet('node/' . $this->test_node->id()); - $this->client->post($stats_path, array(), $post); + $this->client->post($stats_path, array('body' => $post)); $this->assertText('1 view', 'Node is viewed once.'); // statistics_cron() will subtract diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php index a2704d8..3effaf5 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php @@ -93,7 +93,7 @@ function testLogging() { // Manually call statistics.php to simulate ajax data collection behavior. $nid = $this->node->id(); $post = array('nid' => $nid); - $this->client->post($stats_path, array(), $post); + $this->client->post($stats_path, array('body' => $post)); $node_counter = statistics_get($this->node->id()); $this->assertIdentical($node_counter['totalcount'], '1'); } diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php index fed4bdc..3d8309a 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php @@ -38,7 +38,7 @@ function testPopularContentBlock() { $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; $client = \Drupal::httpClient(); $client->setDefaultOption('config/curl', array(CURLOPT_TIMEOUT => 10)); - $client->post($stats_path, $headers, $post); + $client->post($stats_path, array('headers' => $headers, 'body' => $post)); // Configure and save the block. $this->drupalPlaceBlock('statistics_popular_block', array( diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php index e692173..16c1fda 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php @@ -42,7 +42,7 @@ function testStatisticsTokenReplacement() { $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; $client = \Drupal::httpClient(); $client->setDefaultOption('config/curl', array(CURLOPT_TIMEOUT => 10)); - $client->post($stats_path, $headers, $post); + $client->post($stats_path, array('headers' => $headers, 'body' => $post)); $statistics = statistics_get($node->id()); // Generate and test tokens. diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php index e417f27..f7fec46 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php @@ -84,7 +84,7 @@ public function testNodeCounterIntegration() { $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; $client = \Drupal::httpClient(); $client->setDefaultOption('config/curl', array(CURLOPT_TIMEOUT => 10)); - $client->post($stats_path, array(), array('nid' => $this->node->id())); + $client->post($stats_path, array('body' => array('nid' => $this->node->id()))); $this->drupalGet('test_statistics_integration'); $expected = statistics_get($this->node->id());