Fix add custom block inline with Quick Edit

Created on 5 July 2019, over 5 years ago
Updated 11 April 2023, over 1 year ago

Problem/Motivation

When add on custom block inline the quick edition is broken

Steps:

  1. Enable layout builder;
  2. Enable for basic page;
  3. Create the basic page(Save);
  4. After save, go to view, click on layout;
  5. Add Section one column;
  6. Add block >> create custon block;
  7. Enter with title;
  8. Enter with body;
  9. Click add block;

๐Ÿ› Bug report
Status

Closed: duplicate

Version

9.1

Component
Layout builderย  โ†’

Last updated 2 days ago

Created by

๐Ÿ‡ง๐Ÿ‡ทBrazil thalles Teรณfilo Otoni - MG

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia lakhan Thakur

    I solved this issue by

    /**
    * Implements hook_preprocess_HOOK().
    */

    function theme_name_preprocess_media(&$variables) {
    // Fixing the media missed the quick edit attribute.
    if (!empty($variables["elements"]["#media"])) {
    $media = $variables["elements"]["#media"];
    $type = $media->getEntityType()->id();
    $id = $media->id();

    if (!isset($variables['attributes']['data-quickedit-entity-id'])) {
    $variables['attributes']['data-quickedit-entity-id'] = $type . '/' . $id;
    }
    }
    }

    Thanks

Production build 0.71.5 2024