Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / consolidation / output-formatters / src / StructuredData / RenderCellCollectionTrait.php
index c4f23c7d38309495a16e827cba274111c2ce3722..f4f508b7b2b808bdbfa7b718d79ff0107dfc1e3f 100644 (file)
@@ -2,9 +2,12 @@
 namespace Consolidation\OutputFormatters\StructuredData;
 
 use Consolidation\OutputFormatters\Options\FormatterOptions;
+use Consolidation\OutputFormatters\Formatters\FormatterAwareInterface;
+use Consolidation\OutputFormatters\Formatters\FormatterAwareTrait;
 
 trait RenderCellCollectionTrait
 {
+    use FormatterAwareTrait;
 
     /** @var RenderCellInterface[] */
     protected $rendererList = [
@@ -49,10 +52,10 @@ trait RenderCellCollectionTrait
         );
 
         foreach ($flattenedRendererList as $renderer) {
-            $cellData = $renderer->renderCell($key, $cellData, $options, $rowData);
-            if (is_string($cellData)) {
-                return $cellData;
+            if ($renderer instanceof FormatterAwareInterface) {
+                $renderer->setFormatter($this->getFormatter());
             }
+            $cellData = $renderer->renderCell($key, $cellData, $options, $rowData);
         }
         return $cellData;
     }