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 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.

CommentFileSizeAuthor
#5 3293908-5.patch1.24 KBtwfahey
#4 3293908.patch1.23 KBchristian.wiedemann

Issue fork drupal-3293908

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Christian.wiedemann created an issue. See original summary.

christian.wiedemann’s picture

Title: Expose Layout Builder data to REST and JSON:API for entity view display » Expose Layout Builder Sections to entity view displays (jsonapi/entity_view_display/entity_view_display)
christian.wiedemann’s picture

Version: 9.5.x-dev » 9.4.x-dev
StatusFileSize
new1.23 KB

Patch for 9.4

twfahey’s picture

StatusFileSize
new1.24 KB

Rerolled for latest 9.4.5

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

socialnicheguru’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

So #5 was uploaded for others but not to be reviewed as nothing is going into 9.4

MR 2463 has a valid failure for 9.5

To me this feels like a feature request that will need it's own test coverage.

tim.plunkett’s picture

Version: 9.5.x-dev » 10.1.x-dev
Status: Needs work » Postponed (maintainer needs more info)

This is a follow-up to an issue that is not done yet. Either this should be marked as postponed, or fold it into the existing issue and mark this as a duplicate

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Left a comment on the postponed issue.