summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebflo2018-07-03 10:58:17 (GMT)
committerLuca Lusso2018-07-03 10:58:17 (GMT)
commit0e8ffdecc38f197905154a942f3c57636bef61db (patch)
tree1d5e690ce166dca32a8bdc772da214e82c3aa456
parente570f6484a78657a201e2238ee36b08f141e263e (diff)
Issue #2866135 by webflo: Exception when web profiler module enabled
-rw-r--r--webprofiler/src/Entity/Decorators/Config/ImageStyleStorageDecorator.php36
-rw-r--r--webprofiler/src/Entity/EntityManagerWrapper.php4
2 files changed, 40 insertions, 0 deletions
diff --git a/webprofiler/src/Entity/Decorators/Config/ImageStyleStorageDecorator.php b/webprofiler/src/Entity/Decorators/Config/ImageStyleStorageDecorator.php
new file mode 100644
index 0000000..281a6f6
--- /dev/null
+++ b/webprofiler/src/Entity/Decorators/Config/ImageStyleStorageDecorator.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\webprofiler\Entity\Decorators\Config;
+
+use Drupal\Core\Session\AccountInterface;
+use Drupal\image\ImageStyleStorageInterface;
+use Drupal\shortcut\ShortcutSetInterface;
+use Drupal\shortcut\ShortcutSetStorageInterface;
+
+/**
+ * Class ImageStyleStorageDecorator
+ */
+class ImageStyleStorageDecorator extends ConfigEntityStorageDecorator implements ImageStyleStorageInterface {
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setReplacementId($name, $replacement) {
+ return $this->getOriginalObject()->setReplacementId($name, $replacement);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getReplacementId($name) {
+ return $this->getOriginalObject()->getReplacementId($name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clearReplacementId($name) {
+ return $this->getOriginalObject()->clearReplacementId($name);
+ }
+
+}
diff --git a/webprofiler/src/Entity/EntityManagerWrapper.php b/webprofiler/src/Entity/EntityManagerWrapper.php
index c6381a0..3579710 100644
--- a/webprofiler/src/Entity/EntityManagerWrapper.php
+++ b/webprofiler/src/Entity/EntityManagerWrapper.php
@@ -8,6 +8,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\EntityViewBuilderInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\webprofiler\Entity\Decorators\Config\ConfigEntityStorageDecorator;
+use Drupal\webprofiler\Entity\Decorators\Config\ImageStyleStorageDecorator;
use Drupal\webprofiler\Entity\Decorators\Config\RoleStorageDecorator;
use Drupal\webprofiler\Entity\Decorators\Config\ShortcutSetStorageDecorator;
use Drupal\webprofiler\Entity\Decorators\Config\VocabularyStorageDecorator;
@@ -98,6 +99,9 @@ class EntityManagerWrapper extends DefaultPluginManager implements EntityTypeMan
case 'shortcut_set':
return new ShortcutSetStorageDecorator($handler);
break;
+ case 'image_style':
+ return new ImageStyleStorageDecorator($handler);
+ break;
default:
return new ConfigEntityStorageDecorator($handler);
break;