Skip to content

Commit 141fa48

Browse files
committed
Fixes failed tests for Data Object
- fixed toString method for not existing data value
1 parent 1df1880 commit 141fa48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/Magento/Framework/DataObject.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ public function toString($format = '')
368368
} else {
369369
preg_match_all('/\{\{([a-z0-9_]+)\}\}/is', $format, $matches);
370370
foreach ($matches[1] as $var) {
371-
$format = str_replace('{{' . $var . '}}', $this->getData($var), $format);
371+
$data = $this->getData($var) ?? '';
372+
$format = str_replace('{{' . $var . '}}', $data, $format);
372373
}
373374
$result = $format;
374375
}

0 commit comments

Comments
 (0)