Skip to content

Commit

Permalink
Fixed PHP warning for accessing array offset on null (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksantamaria authored Nov 14, 2024
1 parent 4dbcef4 commit 659c9e6
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 659c9e6

Please sign in to comment.