Paragraph Library blocks submission of library items if nested in a parent paragraph.

Created on 2 May 2020, over 4 years ago
Updated 4 June 2024, 6 months ago

Problem/Motivation

I was using the the config pages β†’ modules to create a way to manage out site's banner ads. The banner ads needed to be able to be managed on a per user role basis. So I created two paragraphs. The first was the banner ad which contained all necessary fields. This paragraph is allowed to be added to the library. The second was a Banner Persona paragraph which had a list of our roles and an entity reference to the paragraph library item which loaded banner ads.

When creating the persona field on my config page I selected allowing Banner Persona paragraphs [Image 01]. From there I expected that since the Banner Persona paragraph has a field that adds paragraph library items called banners I should be able to add banner ad paragraphs without any issue. Instead I got an error saying The Banners field cannot contain a Banner Ad paragraph, because the parent Persona field disallows it. [Image 02].

The way I got around this was to go to the persona field on my config page and allow banner ad also [Image 03]. This allowed to save, but it allow gave the user the ability add both a banner ad in place of a Banner Persona as well.

Proposed resolution

Do not make the paragraph library items allowed in a field depend on parent paragraph settings. The allowed paragraphs for the library field should be set on the paragraph library item field itself.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ› Bug report
Status

Active

Version

1.11

Component

Module: Library

Created by

πŸ‡ΊπŸ‡ΈUnited States Jalite1991

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