Module only picks up components from the entities first layout canvas field

Created on 12 January 2022, almost 3 years ago
Updated 8 September 2023, about 1 year ago

Problem/Motivation

I've noticed that the module uses the `_site_studio_get_cohesion_field` function to determine which field has a layout canvas to figure out which components need to have their libraries attached.

The problem is that the current logic only does this for the first layout canvas field it encounters in the entity, resulting in more complex entity architectures with multiple layout canvas fields not having all of their component's libraries loaded.

Steps to reproduce

Add multiple layout canvas fields to an entity. Add multiple components to each of those layout canvas fields. Create component libraries as per the module's instructions. Confirm that only for the first layout canvas field libraries have been loaded.

Proposed resolution

Rework the _site_studio_get_cohesion_field function code to account for multiple layout canvas fields.

Remaining tasks

I'll submit my own patch for this shortly.

User interface changes

None.

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡΅πŸ‡ΉPortugal joum Porto

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024