This is dependent upon #1927608: Remove the tight coupling between Block Plugins and Block Entities

Currently the block form expects to have the entity available in it. Since there's an Entity Form Controller wrapping it, we can't do anything about that, but entities are just one of many potentially acceptable ways a block form could be exposed, and the plugin internals can not be made to expect an entity.

In this process we should move concepts that don't serve the block plugin to the Entity Form Controller. This includes, but is not limited to:

  • The entity id mechanism
  • The region the block appears in
  • potentially the visibility settings of the block (though that should probably be a follow up that uses conditions)

ToDO

#1871696: Convert block instances to configuration entities to resolve architectural issues change notice

CommentFileSizeAuthor
#2 1941948-2.patch5.72 KBEclipseGc
#2 1941948-2-full.patch47.27 KBEclipseGc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

EclipseGc’s picture

Status: Active » Postponed
EclipseGc’s picture

Issue summary: View changes

adding parent issue

EclipseGc’s picture

Status: Postponed » Needs review
FileSize
47.27 KB
5.72 KB

The non-full version of this patch might actually pass, I don't know of a reason it couldn't, but since #1927608: Remove the tight coupling between Block Plugins and Block Entities has stalled I've gone ahead and moved forward with the approach in the followups since I'm happy with my latest patch in that issue.

This patch moves region, id and machine_name out of the BlockBase::form() method and moves it into the BlockFormController. This should clearly separate the form components that are the entity's responsibility and actually open up the entity to doing more if it's deemed relevant/necessary.

Eclipse

EclipseGc’s picture

The full version has a comment inside of the display entity stuff that wasn't meant to be here but shouldn't affect functionality. I'll make sure it's not in the next patch.

EclipseGc’s picture

Issue tags: +Blocks-Layouts, +Block plugins
effulgentsia’s picture

Status: Needs review » Closed (duplicate)
effulgentsia’s picture

Issue summary: View changes

Updated issue summary.