Fix store filter override in admin "add product" popup#657
Fix store filter override in admin "add product" popup#657KrzysztofPajak merged 3 commits intodevelopfrom
Conversation
Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
|
@copilot project Admin do not need to be filtered by store context |
…eProductModel Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Removed the |
|
|
@copilot Check is Grand.Web.Store has limited by StoreContext |
Yes, |
There was a problem hiding this comment.
Pull request overview
Fixes the store filter in the Admin “add product” popup for blog posts by preventing the selected SearchStoreId from being overwritten before querying products.
Changes:
- Removed the unconditional
StaffStoreIdassignment tomodel.SearchStoreIdinBlogViewModelService.PrepareProductModel. - Ensures the selected store filter value is passed through to the product search query.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -209,7 +209,6 @@ public virtual async Task<BlogPost> UpdateBlogPostModel(BlogPostModel model, Blo | |||
| public virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel( | |||
| BlogProductModel.AddProductModel model, int pageIndex, int pageSize) | |||
| { | |||
| var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, | ||
| model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, |
| public virtual async Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel( | ||
| BlogProductModel.AddProductModel model, int pageIndex, int pageSize) | ||
| { | ||
| model.SearchStoreId = _contextAccessor.WorkContext.CurrentCustomer.StaffStoreId; | ||
| var products = await _productService.PrepareProductList(model.SearchCategoryId, model.SearchBrandId, | ||
| model.SearchCollectionId, model.SearchStoreId, model.SearchVendorId, model.SearchProductTypeId, |
|
@copilot please also check |
Checked both locations — they are already correct in
Neither method has an unconditional |



BlogViewModelService.PrepareProductModelunconditionally overwrotemodel.SearchStoreIdwithStaffStoreId, causing the store dropdown filter in the blog post "add product" popup to have no effect.Change
Removed the
StaffStoreId-based store context override entirely, as the Admin project does not need store context filtering:Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.