I think the problem here is simply that the settings form does not clear the cache.
When the block is built it should declare it's dependency on the block settings.
So in a module hook it can be done like this./** * Implements hook_block_view_BASE_BLOCK_ID_alter() */ function my_module_block_view_bootstrap_simple_carousel_block_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) { $build['#cache'] = [ 'tags' => $build['#block']->getCacheTags(), ]; }
but better still, in this module's block plugin Drupal\bootstrap_simple_carousel\Plugin\Block\CarouselBlock::build() should just include this:
$build = [ '#items' => $this->getCarouselItems(), '#settings' => $this->moduleSettings, '#theme' => 'bootstrap_simple_carousel_block', '#cache' => [ 'tags' => $this->moduleSettings->getCacheTags(), ], ];
- af186a76 committed on 8.x-1.x
Issue: #3225942, patch #6 by matslats
- af186a76 committed on 8.x-1.x
- π§πΎBelarus asmdk
Thanks @matslats, your fix was applied in version 8x-1.65 and will move on new ones.
- Status changed to Fixed
9 months ago 8:06pm 18 February 2024 - Assigned to asmdk
- Status changed to Fixed
9 months ago 7:10pm 19 February 2024