Problem/Motivation
When enabled the layout_builder module seize the display for an entity and replace it's fields with derived blocks. For normal fields it offers the posibility to edit the field display instance, but for extra fields since by design they are not configurable from the UI it does not, making us unable to configure any extra field added by this module (if the plugin allow so).

Proposed solution
When enabled along with the layout_builder module, extend the latter ExtraFieldBlock class and replace it with one provided by this module which will ensure those extra fields created using plugins can be properly configured through the block.

Remaining tasks

  1. Create an ExtraFieldBlock extending the one provided by layout_builder module.
  2. Implement hook_block_alter and replace the class for the extra_field_block plugin with the latter.
  3. Update the records

User interface changes
None

Comments

d70rr3s created an issue. See original summary.

d70rr3s’s picture

Title: Integrate with lyaout_builder module » Integrate with layout_builder module

  • d70rr3s committed 8ed94e1 on 8.x-1.x
    Issue #3046144 by d70rr3s: Integrate with layout_builder module
    
d70rr3s’s picture

Status: Active » Fixed

Until other issues may come by, let's consider this as fixed.

nikita_tt’s picture

I noticed an error here broken line

d70rr3s’s picture

Status: Fixed » Needs work

Ah yes, I should be using list construct instead unpacking directly into vars (+7.1). Marked as NW to support <7.1. Thanks @nikita_tt.

// efs.module:231
// Replace this
[$plugin_id] = explode(PluginBase::DERIVATIVE_SEPARATOR, $id, 2);
// with this
list($plugin_id) = explode(PluginBase::DERIVATIVE_SEPARATOR, $id, 2);
// src/Plugin/Block/ExtraFieldBlock.php:142
// Replace this
[, $entity_type, $entity_bundle, $extra_field_name] = explode(self::DERIVATIVE_SEPARATOR, $this->pluginId);
// with this
list(, $entity_type, $entity_bundle, $extra_field_name) = explode(self::DERIVATIVE_SEPARATOR, $this->pluginId);
d70rr3s’s picture

Issue summary: View changes

  • d70rr3s committed 25a2387 on 8.x-1.x
    Issue #3046144 by d70rr3s, nikita_tt: Integrate with layout_builder...
d70rr3s’s picture

Status: Needs work » Needs review
jienckebd’s picture

When saving a layout_builder display, efs_entity_presave() attaches efs blocks from other displays of the same entity type / bundle. So the efs block from another bundle is added each time layout builder form is saved. Not sure why, but this patch seems to fix it.

Please let me know if I'm missing something.

d70rr3s’s picture

Status: Needs review » Fixed

Hi @jienckebd thanks for reporting this, moving into a separate issue since needs a follow up because we may want to use EFS withing layout builder displays. I'm closing this since the may main goal was to EFS be available as a block to be placed by Layout Builder and is completed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.