Problem/Motivation

I'm in the middle of a D7 -> D9 migration, and I'm having issues displaying viewfields for existing paragraphs in layout builder. It seems to me that the 'Always use default value' checkbox isn't being observed for existing paragraphs when using layout builder to display.

I don't believe the issue is related to my migration, but I thought I should mention it, anyway. I'm working completely on the D9 site with existing (migrated) paragraph content, creating new views and viewfields within the existing paragraphs.

I have recreated the issue in a fresh vanilla D9 site to confirm.

For the existing paragraphs, the new view and viewfield will display correctly when using the default display, but not when using layout builder. New paragraph content will display correctly in both default display and in layout builder.

I created an issue a couple days ago for this, but at the time, I didn't yet notice that adding layout builder to the mix is when it broke. So I closed the old issue.

Steps to reproduce

  1. Create paragraph content within a node
  2. Create a view for the paragraph content (images)
  3. Add a viewfield to the paragraph
  4. View the node. Results: viewfield displays correctly
  5. Change the paragraph type display to use layout builder
  6. View the node. Results: viewfield doesn't display
  7. Add new paragraphs to the node
  8. View the node. Results: new paragraphs display correctly, but not existing paragraphs
  9. Disable layout builder for the paragraph
  10. View the node. Results: all viewfields display correctly
  11. Disable the 'Always use default value' option in the viewfield
  12. Edit the node, adding the correct views and arguments to the original paragraphs
  13. Results: all viewfields display correctly, regardless of whether using layout builder or default display

Rather than providing screenshots, I created a video detailing the issue in a vanilla d9 site.

Comments

mkindred created an issue.

scottsawyer’s picture

I am experiencing this with Layout Paragraphs. I have a viewfield in a paragraph. The paragraph has two fields, the viewfield which has a default value set to a specific view / display, the other field is just a simple list_text select list. I have is set up so the editor can not change which view is selected (I removed the viewfield from the paragraph form display).

  • create a node and add the paragraph, in the layout paragraph, I see the view (note, this is before saving).
  • save node. View displays as expected.
  • Edit the node. View displays as expected.
  • Edit the paragraph with the viewfield, the collapse.
  • The view does not display in layout paragraphs.
  • Save the node. View displays as expected.

So, it's like the default value is temporarily lost when editing the paragraph until the entire node is saved. This is a problem for editors because they may think they've done something wrong when the view disappears.