Problem/Motivation
See #2704331: Ability to display block_content entities independently, also outside of Blocks.
Custom blocks (block_content
entities) are not designed to be displayed outside of blocks. But as a developer, you would never be able to figure this out.
Proposed resolution
Document it, so that developers in the future can at least find it it in the most logical place in the code. So that they don't need to search the internet and hope to end up at https://www.drupal.org/node/2704331.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#15 | 2859197-applied_patch.png | 56.97 KB | Abhijith S |
#2 | 2859197-2.patch | 860 bytes | Wim Leers |
Comments
Comment #2
Wim LeersComment #3
Hydra CreditAttribution: Hydra at erdfisch commentedThis rly helped me, was a hard one to find.
Comment #4
lauriiiWouldn't this also interfere non-technical users that are only using the UI? Are we sure it is enough to just document this in the class documentation? Of course, this makes it available in api.d.o but it might not be enough for the non-technical users.
Comment #7
borisson_I don't think #4 applies, there is no way that I can see to display a block in another way by just using core.
Comment #8
swentel CreditAttribution: swentel as a volunteer commented@borisson_ : views, entity reference ? That will render them, but without the block content template.
So yeah, in a way, the best solution is to not allow views or entity reference render them (but not for this patch I guess, and probably over the top). Maybe add it to hook_help as well ?
Comment #9
borisson_Ah, good to know @swentel, I completely forgot about that. Adding it to
hook_help
is a good idea I think.Comment #10
Eric_A CreditAttribution: Eric_A at Dutch Open Projects commentedComment #12
undersound3 CreditAttribution: undersound3 as a volunteer commentedComment #15
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commentedPatch #2 applied cleanly on 9.2.x.
Comment #18
Luke.LeberThis seems like a very serious issue that affects more than just developers. Doesn't this mean that site builders can walk themselves and their clients out of support guarantees simply by configuring a block content entity reference via the user interface?
Given that this issue has been open for almost 5 years, how many sites might already be affected?
Comment #19
AnybodyComment #20
joachim CreditAttribution: joachim at Factorial GmbH commented> Doesn't this mean that site builders can walk themselves and their clients out of support guarantees simply by configuring a block content entity reference via the user interface?
That's a good point about reference fields pointing to block content entities. Could do with a follow-up?
Patch here looks good.
Comment #23
catchOpened a follow-up #3295183: Should custom blocks be referenceable? to discuss the more general issue. But I don't think it hurts to discourage doing this where we can easily then continue trying to discourage it more. Going to be tricky since existing sites might already be doing something with this.
Committed/pushed to 10.1.x and cherry-picked back through to 9.4.x