summaryrefslogtreecommitdiffstats
path: root/src/Normalizer
diff options
context:
space:
mode:
authordamienmckenna2017-05-17 21:14:22 (GMT)
committerMateu Aguiló Bosch2017-05-17 21:14:22 (GMT)
commit416c62f6281692033d367efc132542d9be405994 (patch)
tree8fa16d268074518e172458a9d95c08699ef681ad /src/Normalizer
parent08708f0d245ab3dde25b244e0f5b2fcbdc7a1438 (diff)
fix(Config): Allow FieldEnhancer plugin without settings (#2878938 by DamienMcKenna)
Diffstat (limited to 'src/Normalizer')
-rw-r--r--src/Normalizer/FieldItemNormalizer.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Normalizer/FieldItemNormalizer.php b/src/Normalizer/FieldItemNormalizer.php
index f1e903b..d4df120 100644
--- a/src/Normalizer/FieldItemNormalizer.php
+++ b/src/Normalizer/FieldItemNormalizer.php
@@ -80,9 +80,13 @@ class FieldItemNormalizer extends NormalizerBase {
}
try {
$enhancer_info = $resource_field_info['enhancer'];
+ // Ensure that the settings are in a suitable format.
+ $settings = [];
+ if (!empty($enhancer_info['settings']) && is_array($enhancer_info['settings'])) {
+ $settings = $enhancer_info['settings'];
+ }
// Get the enhancer instance.
/** @var \Drupal\jsonapi_extras\Plugin\ResourceFieldEnhancerInterface $enhancer */
- $settings = $enhancer_info['settings'];
$enhancer = $this->enhancerManager->createInstance(
$enhancer_info['id'],
$settings