- 🇭🇺Hungary mibfire
There is an issue with "applies" method of BatchNegotiator class. This doesn't take the "system.batch_page.json" route into account. So for example while the default theme is used on the "system.batch_page.html" route the admin theme is used on "system.batch_page.json" route. Question is why "system.batch_page.json" route is not taken into account in the "applies" method? In my opinion this should be consistent through the whole batch process regardless of this is the batch page("system.batch_page.html") or the batch ajax calls("system.batch_page.json").
Also the following is how the theme is set for the batch at the beginning.
function batch_process($redirect = NULL, Url $url = NULL, $redirect_callback = NULL) { $batch =& batch_get(); $activeThemeName = \Drupal::service('theme.manager')->getActiveTheme(); $request = \Drupal::request(); if (isset($batch)) { // Add process information $process_info = [ 'current_set' => 0, 'progressive' => TRUE, 'url' => $url ?? Url::fromRoute('system.batch_page.html'), 'source_url' => Url::fromRouteMatch(\Drupal::routeMatch())->mergeOptions(['query' => \Drupal::request()->query->all()]), 'batch_redirect' => $redirect, 'theme' => \Drupal::theme()->getActiveTheme()->getName(), 'redirect_callback' => $redirect_callback, ];
=>
" 'theme' => \Drupal::theme()->getActiveTheme()->getName(),"
So this should apply to the ajax calls too.
I created a patch for this issue.
- 🇮🇹Italy trickfun
In my case, batch page uses right theme but no menu is displayed.
why no block is loaded?thank you