- 🇯🇴Jordan n.ghunaim Amman - Jordan
I'm still facing this issue even when upgrading the core module to 9.5.9
- 🇯🇴Jordan n.ghunaim Amman - Jordan
I have applied a change to make views_bulk_operations.execute_batch routing use the admin theme, this fixes the theming issue for the bulk operations module.
- last update
over 1 year ago 11 pass - Status changed to Needs review
over 1 year ago 3:00pm 14 June 2023 - Status changed to RTBC
over 1 year ago 4:25pm 14 June 2023 - Status changed to Needs work
over 1 year ago 7:15am 15 June 2023 - 🇵🇱Poland Graber
And what if the view having a VBO field is not on admin pages and uses the default theme instead of the admin theme?
- 🇯🇴Jordan Rajab Natshah Jordan
I agree with Marcin on #7
I was sat to add the patch to our product.
But had the same questions.Solution #1: Maybe VBO Edit, VBO Export, or other extending VBO solutions could have switcher for that
Solution #1: A plugin switch checkbox in the advanced view settings, or custom cloned views could manage to change and pass the ( Default theme, or Admin theme ) to the Batch Theme Negotiator
if (batch_theme_view_settings == 'admin') { return $this->configFactory->get('system.theme')->get('admin'); } else { return $this->configFactory->get('system.theme')->get('default'); }
Maybe views already can do this with a bit of hook alters.
I feel that this could be in Drupal core, or a contrib module to select the theme for the batch job under Advanced view settings next to Use AJAX for example.
- Status changed to Needs review
over 1 year ago 11:29pm 4 July 2023 - 🇳🇿New Zealand ericgsmith
Adding related issue.
Reading the issue #2911751
_admin_route: TRUE
was added toviews_bulk_operations.confirm
andviews_bulk_operations.execute_configurable
on the assumption that if the user has access to the admin theme then it was fine then to use that for the configuration form.I think that is the same concern here - but because
_admin_route: TRUE
was not applied to the batch route - if you are not using a configurable plugin or a confirmation screen then you do not get the admin theme and you receive an inconsistent experience.So to answer:
And what if the view having a VBO field is not on admin pages and uses the default theme instead of the admin theme?
#4 would result in the same current behavior for the confirm and configuration forms - these would render as the admin theme if the user has permissions to see it.
Also, what about other controllers like the confirmation and configuration form for actions that require those?
When using confirmation option - The processor is executed in the submit handler for the
ConfirmAction
form so whenbatch_process
is called the current route isviews_bulk_operations.confirm
which has_admin_route: TRUE
so the batch uses the admin theme if you have permissions to use it.When using action with configuration - The processor is executed in the submit handler for the
ConfigureAction
form so whenbatch_process
is called by the plugin the current route isviews_bulk_operations.execute_configurable
which has_admin_route: TRUE
so the batch uses the admin theme if you have permissions to use it.When using action with no configuration or confirmation - ViewsBulkOperationsBulkForm does not execute the plugin, but redirects to
views_bulk_operations.execute_batch
so whenbatch_process
is called by the plugin the current route isviews_bulk_operations.execute_batch
which does not have_admin_route: TRUE
so the batch uses the default theme.Based on that - I would say the patch from #4 does the minimum to keep it consistent - but could introduce edge case regressions where a user with access to the admin theme may expect the batch to run in the front end. In this case, they would already be seeing the admin theme if the action had a configuration or confirmation form.
Alternatively, in ViewsBulkOperationsBulkForm - could this be refactored so that it keeps the existing redirect behavior for configuration and confirm options - but calls execute directly on the plugin and redirects to the batch here rather than delegating this behavior to the
views_bulk_operations.execute_batch
route? I haven't really taken a close look at this route / controller to see if there is anything prohibiting this. That also might not be relevant as while it could solve an edge case, it would still be inconsistent since those 2 routes current using admin wouldn't take the current view into account anyway.That all said - I think #4 keeps things consistent and works for my use case so would be RTBC for me - but setting to needs review to clarify if its still needs work based on #7. Thanks @n.ghunaim !
- Status changed to RTBC
4 months ago 11:11pm 1 August 2024 - 🇳🇿New Zealand ericgsmith
- Status changed to Fixed
2 months ago 6:43am 18 September 2024 - 🇵🇱Poland Graber
Ok, let's have it. We'll see if we don't have other issues reported.
Automatically closed - issue fixed for 2 weeks with no activity.