Expose Layout Builder Sections to entity view displays (jsonapi/entity_view_display/entity_view_display)

Created on 2 July 2022, over 2 years ago
Updated 23 April 2023, almost 2 years ago

Problem/Motivation

Layout builder Sections are removed jsonapi entity view displays.

This is follow up issue for Expose Layout Builder data to REST and JSON:API πŸ“Œ [PP-1] Expose Layout Builder data to REST and JSON:API Postponed and Allow marking a config schema types to be marked as "internal" (to avoid exposing them via HTTP APIs) β†’ .

Steps to reproduce

Open an entity view display "jsonapi/entity_view_display/entity_view_display". There is no "sections" under "third_party_settings/layout_builder"

The responsibe code is "Drupal\jsonapi\Normalizer\ResourceObjectNormalizer:196";

      // @todo Replace this workaround after https://www.drupal.org/node/3043245
      //   or remove the need for this in https://www.drupal.org/node/2942975.
      //   See \Drupal\layout_builder\Normalizer\LayoutEntityDisplayNormalizer.
      if ($context['resource_object']->getResourceType()->getDeserializationTargetClass() === 'Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay' && $context['resource_object']->getField('third_party_settings') === $field) {
        unset($field['layout_builder']['sections']);
      }

Proposed resolution

This patch remove this unset.

πŸ“Œ Task
Status

Postponed: needs info

Version

10.1 ✨

Component
JSON APIΒ  β†’

Last updated 8 days ago

Created by

πŸ‡©πŸ‡ͺGermany Christian.wiedemann

Live updates comments and jobs are added and updated live.
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.

Production build 0.71.5 2024