Problem/Motivation

When you create a block in Facets and save it, it's not immediately visible in the blocks section of Drupal.
After clearing the cache, it becomes visible.

Proposed resolution

After saving the facet, clear the caches.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

Novitsh created an issue. See original summary.

Novitsh’s picture

Status: Active » Needs work
FileSize
431 bytes

Suggestion patch attached.

borisson_’s picture

Issue summary: View changes
Issue tags: -cache

The patch you suggested is way too aggressive, we should only clear cache for the relevant cache tags and use Cache::invalidateTags(); instead.

Novitsh’s picture

Status: Needs work » Needs review
FileSize
684 bytes

Now making use of the plugin.manager.block service to clear only the block caches.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Noticed one small thing, but that can be fixed on commit. Looks great otherwise.

  1. +++ b/src/Form/FacetForm.php
    @@ -7,6 +7,7 @@
    +use Drupal\Core\Cache\Cache;
    

    The use is not needed anymore.

Novitsh’s picture

borisson_’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the issue and the patches. Awesome work.

  • borisson_ committed 6904e34 on 8.x-1.x authored by Novitsh
    Issue #2661724 by Novitsh: Facet block not immediately visible in '...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.