Problem/Motivation

I'm trying to display a paragraph field with the design formatter and I'm not seeing anything. Think it's because for FieldFormatterSource:getMarkup() is calling toString or __toString if those methods exist, for objects.

Steps to reproduce

Try rendering a paragraph field with the field formatter source.

Proposed resolution

For objects that are instances of ContentEntityBase, render them with the view builder.

CommentFileSizeAuthor
#2 render_complex_entities-3271587-2.patch3.43 KBrromore

Comments

rromore created an issue. See original summary.

rromore’s picture

StatusFileSize
new3.43 KB

Attaching a patch which does uses the entities view builder to render the entity. Not sure if this needs to be done for the other submodules as well.

rromore’s picture

Issue summary: View changes
rhys’s picture

I like the principle of this as a solution (although I don't think I've tried the combination you're currently using). Since this getMarkup() functionality is used in a few places, I'm going to be separating it out into a helper class, and ensuring it's used in those places.

My greatest concern is that I've not yet written enough tests (I've been building this module for another project). That aside, I'm fairly confident this won't break existing rendering process (but it's really hard to known without comprehensive test coverage).

  • rhys committed 9b215c1 on 1.0.x authored by rromore
    Issue #3271587 by rromore, rhys: Paragraph fields not rendering
    
rhys’s picture

Status: Active » Fixed
rhys’s picture

Status: Fixed » Closed (fixed)