Skip to content

Commit

Permalink
Cleaner (really not) check
Browse files Browse the repository at this point in the history
- Checks if the actual route == view one (for pages)
- Checks if either layout builder OR a block and if so if only if op !== "do" and no set id ... no Settings/intermediate form should kick in here, but i will also test with the other plugins (Webform one)
  • Loading branch information
DiegoPino committed May 7, 2024
1 parent 1ab811f commit 473aa3e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,21 @@ public function updateFacetCache(ViewsBulkOperationsEvent $event) {
$exposed_input = $event->getView()->getExposedInput();
$tempStoreName = 'ami_vbo_batch_facets_' . md5($event->getView()->id() . '_' . $event->getView()->current_display);
// Do not override once the batch starts.
// Maybe delete when on view.solr_search_content_with_find_and_replace.page_1?
// We do not know here if facets will or not be in a f[] so we pass
// all. The processor will know/read from the URL Processor settings.
// Do not overridewrite once the batch starts. Arguments will be 'op' = 'do', _format = 'json', id = a number the batch id
// all values (also good, respects filters).
// The VBO URL facet processor will know/read from the URL Processor settings.
// Do not overridewrite once the batch starts or we will end with 0 filters.
// Arguments will be 'op' = 'do', _format = 'json', id = a number the batch id
// Normally just checking if this is happening under the unbrella of the actual Views Route is enough
// BUT ... we need to also take in account layout builder .. so in that case we check for 'op' !== do && id (the batch)
// Just in case.
// @TODO. No idea how to deal with the blocks and other options
// I could to the opposite> Save it anytime it is not a batch but bc Facets are basically processed all the time
// anywhere that would be a lot of extra processing time.
if ((\Drupal::routeMatch()->getRouteName() == 'view'. '.' . $event->getView()->id(). '.' .$event->getView()->current_display) ||
\Drupal::routeMatch()->getRouteObject()->getOption('_layout_builder') && $exposed_input['op']!== "do" && !isset($exposed_input['id'])) {
(
(\Drupal::routeMatch()->getRouteObject()->getOption('_layout_builder') ||
$event->getView()->display_handler->getBaseId() == 'block') && (($exposed_input['op'] ?? NULL) !== "do") && !isset($exposed_input['id']))
) {
$this->tempStoreFactory->get($tempStoreName)->set(
$this->currentUser->id(), $exposed_input ?? []
);
Expand Down

0 comments on commit 473aa3e

Please sign in to comment.