Don't use view render() method, instead use preview() method, because render() method breakable embedded view.

\Drupal\views\ViewExecutable::render() comment:

"   * Renders this view for a certain display.
   *
   * Note: You should better use just the preview function if you want to
   * render a view."

Comments

nevergone created an issue. See original summary.

nevergone’s picture

StatusFileSize
new436 bytes
nevergone’s picture

Status: Active » Needs work
damienmckenna’s picture

Status: Needs work » Needs review
crutch’s picture

StatusFileSize
new258.55 KB
new197.86 KB
new47.46 KB
new71.15 KB
new48.88 KB
new91.79 KB

Patch applies and seeing no issues. Below may be a different issue than this but I thought this may fix what we are experiencing but it didn't.

We are still having the problem where views-field-view embed content disappears (when text is displayed) or shows multiple (when entity reference is used) when editing a parent view.

For example
View 1:Block 1: contains view-field-view embed field.
View 2: contains views embeds. It is used in View 1 and other Views.

When editing any part of View 1:Block 1 and saving, the embedded content disappears for plain text or it displays multiples of an entity reference. In order to get back to normal, we must go to View 2 and simply Save. It then reappears (text) or reduces to a single item (entity ref).

Any combination of {{ raw_arguments.nid }} {{ raw_fields.nid }} on both Views has no effect.

There are no errors and is happening for beta and dev.

vladimiraus’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Applies and works
Thanks for the commit and testing 🍻

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you everyone for your contributions.
Merged. 🍻

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • vladimiraus committed a9ce32ad on 8.x-1.x
    fix: #3201100 Don't use view render() method
    
    By: nevergone
    By:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.