Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293617

EntityDisplay::build() requires $item->_attributes to be set.

$
0
0

Problem/Motivation

#1867518: Leverage entityDisplay to provide fast rendering for fields added the following piece of code:

        foreach ($field_names as $field_name) {
+          if ($entity->hasField($field_name)) {
+            foreach ($entity->get($field_name) as $item) {
+              $item->_attributes = array();
+            }
+          }
+        }
$this->fieldOutput[$entity->id()] = $displays[$bundle]->build($entity, $bundle_fields[$bundle]);

It should better not have to do that.

Proposed resolution

Add _attributes in $display->build directly

Remaining tasks

User interface changes

API changes


Viewing all articles
Browse latest Browse all 293617

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>