Closed (fixed)
Project:
Paragraphs Collection
Version:
8.x-1.x-dev
Component:
Library
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
30 May 2017 at 11:19 UTC
Updated:
20 Jul 2017 at 07:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
miro_dietikerI guess you mean that the "add to library" action is not displayed?
A validation is a bit late.
I proposed that we should have a checkbox if a paragraph type is allowed to be put into the library.
Are we now only looking at selection plugin settings?
Comment #3
berdirno, I'm not talking about add to library.
I'm talking about adding a library paragraph and then selecting one through auto-complete (or entity browser, or ..).
Not sure if there's an easy way to already limit it in the autocomplete/selection plugin, that's why I said validation.
maybe we have access to the field then it might be possible. needs to be investigated.
Comment #4
primsi commentedComment #5
primsi commentedAs per discussion, we will define a third party setting per paragraph type, that states, that this paragraph type can be converted into a library item. We will then check for that while displaying the button and possible creating the library entity.
Comment #6
primsi commentedThis relies on #2884095: Add paragraphs entity to hook_paragraph_widget_dropbutton_alter. Also a bit of scope creep with the use statements.
Comment #7
miro_dietikerCommitted the other. Now let's see.
Comment #9
miro_dietiker:-) Schema errors for paragraphs.paragraphs_type.text with the following errors: paragraphs.paragraphs_type.text:third_party_settings.paragraphs_library.disallow_library_conversion missing schema
Comment #10
primsi commentedLet's try again.
Comment #11
berdirthis means it is an opt-out and not an opt-in, not sure what makes more sense.
I think we have getParagraphType() on $paragraph for this, problem is just that ParagraphsInterface is missing most of the methods it should have.
Other than that, this looks pretty good. Only problem is that this is not what I created this issue for, it was the other side of this problem, the part where you can select whatever kind of library item you want and store it, even though the target paragraph type wouldn't be allowed in this context. We either need a new issue for what the issue was about or a new issue for what the patch is about :)
Comment #12
primsi commentedI first did it the other way around, but then it felt to me that this way to be more natural. I thought that if one installs paragraphs_library, having the ability to convert paragraphs to library without additional steps is what I would expect. Both approaches are valid though.
:) Then given that we already derailed this issue my vote goes for a to rename this issue and add another one.
Comment #14
primsi commentedDid not rebase.
Comment #15
primsi commentedFollow up: #2884387: Do in fact validate library paragraphs
Comment #16
primsi commentedAs per discussion, require per type allow conversion.
Comment #17
primsi commentedFixed schema type.
Comment #18
mbovan commentedRerolled.
Comment #19
miro_dietikerDon't show this checkbox on from_library type.
Comment #20
primsi commentedThis applies now only for type "from_library". Not sure if there is a better way to do it.
Comment #21
miro_dietikerI think the label should more mention the library to be valuable. But at least in a test module i have seen this label skipped on this level.
Other than that i think we should get this in.
Comment #23
primsi commentedCorrected the label and committed.