From 70e9ea1d5e1cdd9104ac873826c0dd67b943a23f Mon Sep 17 00:00:00 2001 From: d11n Date: Tue, 16 Jan 2024 08:55:38 +0100 Subject: [PATCH] POS: Fix missing store branding property on form error case (#5658) When a POS has a form, which results in an error state, the store branding property was not set. This adds the missing property and also does not render the store branding partial, in case the model property isn't present. Fixes #5655. --- .../PointOfSale/Controllers/UIPointOfSaleController.cs | 5 ++++- BTCPayServer/Views/Shared/LayoutHead.cshtml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs b/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs index 98c239342..ab02bec81 100644 --- a/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs +++ b/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs @@ -516,10 +516,13 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers } } + var store = await _appService.GetStore(app); + var storeBlob = store.GetStoreBlob(); + viewModel.FormName = formData.Name; viewModel.Form = form; - viewModel.FormParameters = formParameters; + viewModel.StoreBranding = new StoreBrandingViewModel(storeBlob); return View("Views/UIForms/View", viewModel); } diff --git a/BTCPayServer/Views/Shared/LayoutHead.cshtml b/BTCPayServer/Views/Shared/LayoutHead.cshtml index f30cdd04e..c0232b7cd 100644 --- a/BTCPayServer/Views/Shared/LayoutHead.cshtml +++ b/BTCPayServer/Views/Shared/LayoutHead.cshtml @@ -15,7 +15,7 @@ -@if (ViewData.TryGetValue("StoreBranding", out var storeBranding)) +@if (ViewData.TryGetValue("StoreBranding", out var storeBranding) && storeBranding != null) { }