- Issue created by @phenaproxima
- Merge request !450Issue #3494371 by pameeela: Update 'Archived / Unpublished' state to... β (Open) created by phenaproxima
- First commit to issue fork.
The pipeline failed in previous approach due to a test failure caused because the interface
LayoutEntityDisplayInterface
extendsSectionListInterface
. This causes the following condition:if (($display instanceof LayoutEntityDisplayInterface && $display->isLayoutBuilderEnabled()) || $display instanceof SectionListInterface) {
to be true for both Layout Builder enabled displays and displays without it, leading to test failures.
To fix this, I updated the code to get the default view display for the node's content type directly, instead of relying on the Layout Builder field list display object (
Drupal\layout_builder\Field\LayoutSectionItemList
).$display_repository = $this->container->get(EntityDisplayRepositoryInterface::class); $listing_page_display = $display_repository->getViewDisplay('node', $listing_page->bundle());
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Adding credit based on the MR.
- πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
Tests failing, Moving back to Needs Work.
The issue arises because
LayoutEntityDisplayInterface
extendsSectionListInterface
, meaning that any display implementingLayoutEntityDisplayInterface
is also an instance ofSectionListInterface
. This causes the condition($display instanceof LayoutEntityDisplayInterface && $display->isLayoutBuilderEnabled()) || $display instanceof SectionListInterface )
to incorrectly include displays that are not layout-enabled (e.g., card/teaser displays) because they satisfy the instance of
SectionListInterface
check.