Skip to content
Snippets Groups Projects

Issue #3368855: Admin theme not active when using batch export method and a...

4 files
+ 163
4
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -931,13 +931,19 @@ class DataExport extends RestExport {
*/
protected function getRoute($view_id, $display_id) {
$route = parent::getRoute($view_id, $display_id);
$view = Views::getView($view_id);
$view->setDisplay($display_id);
// If this display is going to perform a redirect to the batch url
// make sure thr redirect response is never cached.
if ($view->display_handler->getOption('export_method') == 'batch') {
if ($this->getOption('export_method') == 'batch') {
$route->setOption('no_cache', TRUE);
// Additionally if the path is an admin path we need to set the
// _admin_route option to TRUE so the batch process is executed in the
// same theme as we'd normally expect for the path even though this is
// not an HTML route.
if (str_starts_with($this->getOption('path') ?? '', 'admin/')) {
$route->setOption('_admin_route', TRUE);
}
}
return $route;
}
Loading