From 4aa209814134743650cac8e08eaf2b5525491781 Mon Sep 17 00:00:00 2001 From: KrzysztofPajak Date: Wed, 26 Aug 2026 21:11:33 +0200 Subject: [PATCH] fix(admin): resolve partial-view name collision in Order AddressEdit Admin/Order/AddressEdit threw InvalidOperationException: the model item passed into the ViewDataDictionary is of type OrderAddressModel, but the ViewDataDictionary instance requires AddressModel. Root cause: the shared partial "Partials/CreateOrUpdateAddress" used by Grand.Web.AdminShared's Order/AddressEdit.cshtml has the same relative name as the storefront's own Views/Shared/Partials/CreateOrUpdateAddress.cshtml (@model AddressModel) in Grand.Web. In the combined host, ASP.NET Core's default area view location fallback "/Views/Shared/{0}.cshtml" is checked before the project's own custom AdminShared fallback location, so the storefront's partial (bound to AddressModel) was resolved instead of the intended AdminShared Order partial (bound to OrderAddressModel), causing the model type mismatch. Fix: rename the AdminShared Order partial to Partials/OrderCreateOrUpdateAddress, which no longer collides with any storefront view name, and update the one reference to it. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01QArzgnTu2jhTmm4LiMjuNF --- .../Views/AdminShared/Order/AddressEdit.cshtml | 2 +- ...OrUpdateAddress.cshtml => OrderCreateOrUpdateAddress.cshtml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/Partials/{CreateOrUpdateAddress.cshtml => OrderCreateOrUpdateAddress.cshtml} (100%) diff --git a/src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/AddressEdit.cshtml b/src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/AddressEdit.cshtml index 186c120c8..1b6283fbc 100644 --- a/src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/AddressEdit.cshtml +++ b/src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/AddressEdit.cshtml @@ -29,7 +29,7 @@
- +
diff --git a/src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/Partials/CreateOrUpdateAddress.cshtml b/src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/Partials/OrderCreateOrUpdateAddress.cshtml similarity index 100% rename from src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/Partials/CreateOrUpdateAddress.cshtml rename to src/Web/Grand.Web.AdminShared/Views/AdminShared/Order/Partials/OrderCreateOrUpdateAddress.cshtml