Commit e2f5e050 authored by Pawel G's avatar Pawel G
Browse files

Changing CacheableResponse back to Response because of caching problems.

parent cb9c6cc0
...@@ -52,7 +52,9 @@ class Batch { ...@@ -52,7 +52,9 @@ class Batch {
case 'form': case 'form':
break; break;
case 'drush': case 'drush':
case 'cron':
print $this->batch['init_message'] . "\r\n"; print $this->batch['init_message'] . "\r\n";
// drush_log($this->batch['init_message']);
$this->batch =& batch_get(); $this->batch =& batch_get();
$this->batch['progressive'] = FALSE; $this->batch['progressive'] = FALSE;
if (function_exists('drush_backend_batch_process')) if (function_exists('drush_backend_batch_process'))
...@@ -60,11 +62,6 @@ class Batch { ...@@ -60,11 +62,6 @@ class Batch {
else else
batch_process(); batch_process();
break; break;
case 'cron':
$this->batch =& batch_get();
$this->batch['progressive'] = FALSE;
batch_process();
break;
} }
} }
...@@ -120,7 +117,7 @@ class Batch { ...@@ -120,7 +117,7 @@ class Batch {
* *
* @see https://api.drupal.org/api/drupal/core!includes!form.inc/group/batch/8 * @see https://api.drupal.org/api/drupal/core!includes!form.inc/group/batch/8
*/ */
static function generate_bundle_urls($query, $info, $batch_info, &$context) { public static function generate_bundle_urls($query, $info, $batch_info, &$context) {
$languages = \Drupal::languageManager()->getLanguages(); $languages = \Drupal::languageManager()->getLanguages();
$default_language_id = Simplesitemap::get_default_lang_id(); $default_language_id = Simplesitemap::get_default_lang_id();
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace Drupal\simple_sitemap\Controller; namespace Drupal\simple_sitemap\Controller;
use Drupal\Core\Cache\CacheableResponse; //use Drupal\Core\Cache\CacheableResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Drupal\simple_sitemap\Simplesitemap; use Drupal\simple_sitemap\Simplesitemap;
...@@ -29,6 +29,7 @@ class SimplesitemapController { ...@@ -29,6 +29,7 @@ class SimplesitemapController {
$output = $sitemap->get_sitemap($sitemap_id); $output = $sitemap->get_sitemap($sitemap_id);
// Display sitemap with correct xml header. // Display sitemap with correct xml header.
return new CacheableResponse($output, Response::HTTP_OK, array('content-type' => 'application/xml')); // return new CacheableResponse($output, Response::HTTP_OK, array('content-type' => 'application/xml'));
return new Response($output, Response::HTTP_OK, array('content-type' => 'application/xml'));
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment