Problem/Motivation
When a paragraphs library item contains a paragraph type that may not be used in a field of a content, when saving the content, a validation error will prevent the content from being saved. The constraint's id that causes this error is "ParagraphsLibraryItemHasAllowedParagraphsType".
This may be an unexpected behavior and may also sometimes be undesirable.
An use case is when the paragraphs library item is set by a trusted editor and once is defined it should be allowed to be used in any paragraph field that has the "from library" option, whatever are the paragraph types that the paragraphs library item has in it.
Steps to reproduce
- Create paragraph types A (check option Allow adding to library) and B
- Create a content type with a paragraph field that may use paragraphs B and From library
- Add a library item with paragraph A
- Create a content of the new content type and in the paragraph field add from library the reusable paragraph A
An error will be displayed:
The Reusable paragraph field cannot contain a A paragraph, because the parent Paragraphs field disallows it.
Proposed resolution
My proposal is to allow to not impose the mentioned constraint, through a configuration setting.
I consider that just the fact that this configuration setting exists is beneficial by itself, because by reading the settings page of the module, a developer will be aware of the mentioned constraint, that otherwise could be unexpected (it was unexpected for me).