Skip to content

Show a product without a layout in the default layout - #1124

Merged
KrzysztofPajak merged 1 commit into
developfrom
fix/product-layout-fallback
Nov 27, 2026
Merged

KrzysztofPajak merged 1 commit into
developfrom
fix/product-layout-fallback

Conversation

@KrzysztofPajak

Copy link
Copy Markdown
Member

Type: bugfix

Issue

A product created through the Web API (or an import) without a ProductLayoutId fails its storefront page with a 500: ArgumentNullException: Value cannot be null. (Parameter 'request.ProductLayoutId') in GetProductLayoutViewPathHandler. The handler rejected the empty id before the fallback to the first layout on the very next line could run.

Solution

The guard is removed, so a product without a layout (or with a deleted one) is shown in the default layout, as categories, brands and collections already are. A store with no product layout at all still fails, as before.

Breaking changes

None.

Testing

  1. Create a product through the Web API without ProductLayoutId, published and visible individually.
  2. Open its page in the storefront: it shows in the default layout instead of a 500.

GetProductLayoutViewPathHandlerTests covers a known layout, no layout, an empty id, a deleted layout and no layouts at all.

A product created through the API or an import without a ProductLayoutId failed its storefront
page with a 500: the handler rejected the empty id before its fallback to the default layout
could run. Categories, brands and collections already fall back the same way.
Copilot AI balanced review requested due to automatic review settings November 26, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@KrzysztofPajak
KrzysztofPajak merged commit b0dc372 into develop Nov 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants