Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
block.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
25 Apr 2014 at 02:14 UTC
Updated:
28 Jul 2023 at 10:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
larowlanComment #4
catchSo from #2248369: [meta] Deploying configuration that depends on content I ought to just test it.., but it's my impression that it's impossible to create a custom block in staging, then export it to production and have it work.
With reference fields, you can create the content on production, sync the database back to staging, then create the configuration entities. Because the content entities already exist on production, the stage will work fine.
With custom blocks, it's not possible to create the custom block content entity on production, without also creating a block configuration entity at the same time. This means any workflow which requires config to go staging -> production becomes impossible.
I'm not really keen on expanding the 'broken handlers' concept to other modules in core, we already have an issue to remove that in views #1822048: Introduce a generic fallback plugin mechanism. Additionally if the situation is as described above, every staged custom block is going to be 'broken' by design - just it'll have broken handlers instead of random PHP errors.
Comment #5
catchClarifying the issue title and bumping to critical.
Comment #6
catchI think we should make it so that the blocks UI allows you to create a block content entity without also creating the plugin instance.
That would bring the problem to the same level as #2248369: [meta] Deploying configuration that depends on content where you can do the following:
1. Create the content entity on production
2. Sync the database back to staging/dev
3. Create the configuration that depends on the content entity.
4. Successfully sync the configuration to production since the dependency is met
Which is not great but at least possible.
Comment #7
catchSpoke to Tim Plunkett in irc, I hadn't realised the UI is already a two-step form and there's no requirement to place a custom block.
So this means the horrible workflow in #6 is doable now. Closing as duplicate since there's nothing specific here we can't cover in the other issue.
Comment #8
larowlanNow that #1822048: Introduce a generic fallback plugin mechanism is in, we can utilize that - retitling appropriately
Comment #9
larowlanComment #10
larowlanComment #11
larowlanComment #12
tim.plunkettThese are normally indented two spaces.
Overkill, this is the default #type
:)
Comment #14
larowlanFixes #12 and fails
Comment #16
vijaycs85we got another block_content inside settings...
Comment #17
tim.plunkettThis looks like the view_mode ended up on the wrong level. Why did this pass?
Shouldn't it have caused a missing schema error?
I'm not picky about where it ends up, either level.
Comment #18
larowlanWe need to remove the nested field values in BlockContentBlock::blockForm - will tackle later today
Comment #19
larowlanFixes #17
Comment #21
larowlanComment #22
larowlanComment #23
andyposts/"the a"/the
maybe it's ok to display them to allow their deletion at least?
no need in extra line
Comment #24
arla commentedGreat, this seems to work well in a real case at hand.
Nitpick: double article "the a".
Nitpick: typehinting the
$formparameter witharrayseems to be preferrable.Comment #25
tim.plunkett#24.2, the parent class doesn't use that typehint, so this class cannot.
Once the other nitpicks are in, this is RTBC.
Comment #26
larowlanComment #27
tim.plunkettThis is not in getDefinitions, but getSortedDefinitions. This is really only used for the candidate blocks. Unsetting here would not prevent it from appearing in the list of placed blocks.

Comment #28
larowlanthat was my original fear too
Comment #29
tim.plunkettThanks!
Comment #30
alexpottCommitted 96dd466 and pushed to 8.0.x. Thanks!
Removed unnecessary use on commit.
Comment #33
wim leersThis is causing some problems down the line: #3377709: BlockManager is too eager in providing fallback to "Broken" block: it obscures genuine problems.