diff --git a/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php b/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php index 878d6c938..6f19e0c69 100644 --- a/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php +++ b/modules/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php @@ -23,14 +23,12 @@ class YamlEnhancer extends ResourceFieldEnhancerBase { */ protected function doUndoTransform($data, Context $context) { $data = Yaml::decode($data); - $markup_text = $data['markup']['#markup']; - $processed_text = $data['processed_text']['#text']; - - if (!empty($processed_text)) { - $data['processed_text']['#text'] = $this->processText($processed_text); + + if (!empty($data['markup']['#markup'])) { + $data['processed_text']['#text'] = $this->processText($data['markup']['#markup']); } - if (!empty($markup_text)) { - $data['markup']['#markup'] = $this->processText($markup_text); + if (!empty($data['markup']['#markup'])) { + $data['markup']['#markup'] = $this->processText($data['markup']['#markup']); } return $data;