Skip to content
Snippets Groups Projects
Commit 2020afb3 authored by Joshua Sedler's avatar Joshua Sedler :cartwheel_tone2:
Browse files

Fix issue

parent 5c631b25
No related branches found
Tags 8.x-1.19
No related merge requests found
......@@ -23,7 +23,7 @@ class PhotoswipeDynamicCaptionSettings extends ConfigFormBase {
/**
* The dynamic page cache.
*
* @var \Drupal\Core\Cache\CacheBackendInterface
* @var \Drupal\Core\Cache\CacheBackendInterface|null
*/
protected $dynamicPageCache;
......@@ -34,10 +34,10 @@ class PhotoswipeDynamicCaptionSettings extends ConfigFormBase {
* The factory for configuration objects.
* @param \Drupal\Core\Cache\CacheBackendInterface $render_cache
* Constructor.
* @param \Drupal\Core\Cache\CacheBackendInterface $dynamic_page_cache
* @param \Drupal\Core\Cache\CacheBackendInterface|null $dynamic_page_cache
* The captcha service.
*/
public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $render_cache, CacheBackendInterface $dynamic_page_cache) {
public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $render_cache, ?CacheBackendInterface $dynamic_page_cache) {
parent::__construct($config_factory);
$this->renderCache = $render_cache;
$this->dynamicPageCache = $dynamic_page_cache;
......@@ -50,7 +50,7 @@ class PhotoswipeDynamicCaptionSettings extends ConfigFormBase {
return new static(
$container->get('config.factory'),
$container->get('cache.render'),
$container->get('cache.dynamic_page_cache')
$container->has('cache.dynamic_page_cache') ? $container->get('cache.dynamic_page_cache') : NULL,
);
}
......@@ -136,7 +136,11 @@ class PhotoswipeDynamicCaptionSettings extends ConfigFormBase {
// @todo This can probably be more fine graded in the future:
$this->renderCache->invalidateAll();
$this->dynamicPageCache->invalidateAll();
// If the "Internal Dynamic Page Cache" module isn't installed, the
// dynamicPageCache variable will be NULL:
if ($this->dynamicPageCache !== NULL) {
$this->dynamicPageCache->invalidateAll();
}
}
/**
......
......@@ -24,7 +24,7 @@ class PhotoswipeSettings extends ConfigFormBase {
/**
* The dynamic page cache.
*
* @var \Drupal\Core\Cache\CacheBackendInterface
* @var \Drupal\Core\Cache\CacheBackendInterface|null
*/
protected $dynamicPageCache;
......@@ -35,10 +35,10 @@ class PhotoswipeSettings extends ConfigFormBase {
* The factory for configuration objects.
* @param \Drupal\Core\Cache\CacheBackendInterface $render_cache
* Constructor.
* @param \Drupal\Core\Cache\CacheBackendInterface $dynamic_page_cache
* @param \Drupal\Core\Cache\CacheBackendInterface|null $dynamic_page_cache
* The captcha service.
*/
public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $render_cache, CacheBackendInterface $dynamic_page_cache) {
public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $render_cache, ?CacheBackendInterface $dynamic_page_cache) {
parent::__construct($config_factory);
$this->renderCache = $render_cache;
$this->dynamicPageCache = $dynamic_page_cache;
......@@ -51,7 +51,7 @@ class PhotoswipeSettings extends ConfigFormBase {
return new static(
$container->get('config.factory'),
$container->get('cache.render'),
$container->get('cache.dynamic_page_cache')
$container->has('cache.dynamic_page_cache') ? $container->get('cache.dynamic_page_cache') : NULL,
);
}
......@@ -446,7 +446,11 @@ class PhotoswipeSettings extends ConfigFormBase {
// @todo This can probably be more fine graded in the future:
$this->renderCache->invalidateAll();
$this->dynamicPageCache->invalidateAll();
// If the "Internal Dynamic Page Cache" module isn't installed, the
// dynamicPageCache variable will be NULL:
if ($this->dynamicPageCache !== NULL) {
$this->dynamicPageCache->invalidateAll();
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment