Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / consolidation / output-formatters / src / StructuredData / RowsOfFields.php
index bc88e6d190ed7eec79daa36de0525687a9ef30eb..9ca1e38602eddf85a5c4282ad6c227979d747b79 100644 (file)
@@ -10,8 +10,21 @@ use Consolidation\OutputFormatters\Options\FormatterOptions;
  *
  * It is presumed that every row contains the same keys.
  */
-class RowsOfFields extends AbstractStructuredList
+class RowsOfFields extends AbstractStructuredList implements ConversionInterface
 {
+    /**
+     * @inheritdoc
+     */
+    public function convert(FormatterOptions $options)
+    {
+        $defaults = $this->defaultOptions();
+        $fields = $this->getFields($options, $defaults);
+        if (FieldProcessor::hasUnstructuredFieldAccess($fields)) {
+            return new UnstructuredListData($this->getArrayCopy());
+        }
+        return $this;
+    }
+
     /**
      * Restructure this data for output by converting it into a table
      * transformation object.