Problem/Motivation
With the Component views style, "Force using fields" checked and the "[View] Rows" source in a slot, a view with one result gives the slot the fields of that row instead of a list with one row. A template that loops on the slot then loops on the fields.
Steps to reproduce
- Create a view with the Component style and check "Force using fields".
- Pick a component whose template loops on a slot, and put the "[View] Rows" source in that slot.
- Filter the view so it returns one result.
Proposed resolution
The component builder unwraps single-item arrays at every level, so it also removes the extra level the views source adds for a single row. We could unwrap one level only, then remove empty arrays as it does today.
Add a kernel test for a view with one row, and one for the comment form in a slot.
Comments
Comment #4
just_like_good_vibes