Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 22, 2025

  • Analyzed existing codebase structure
  • Identified Store area structure with controllers and views
  • Reviewed existing Admin Blog functionality
  • Created BlogController for Store area
  • Added Blog management views to Store area (List, Create, Edit, Preview)
  • Created required partials and templates for Blog management
  • Verified routing and navigation configuration
  • Confirmed integration with existing menu system
  • Removed store restrictions from Admin BlogController per feedback
  • Fixed missing using directive for BlogPostModel in Store _ViewImports.cshtml
  • Fixed GetAllBlogPosts method call parameter mismatch

Latest Fix:

Corrected the GetAllBlogPosts method call in the Store BlogController's List action. The issue was that the method was being called with incorrect positional parameters, causing a type mismatch where a string was being passed for a DateTime? parameter.

Changed from:

var blogPosts = await _blogService.GetAllBlogPosts(storeId, "", command.Page - 1, command.PageSize);

To:

var blogPosts = await _blogService.GetAllBlogPosts(storeId, 
    pageIndex: command.Page - 1, pageSize: command.PageSize);

This uses named parameters to explicitly specify pageIndex and pageSize, avoiding the type conversion error and ensuring the correct method overload is used.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits September 22, 2025 17:01
Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Add Blog management functionality to Store area Add Blog management functionality to Store area Sep 22, 2025
Copilot finished work on behalf of KrzysztofPajak September 22, 2025 17:10
@Copilot Copilot AI requested a review from KrzysztofPajak September 22, 2025 17:10
@KrzysztofPajak
Copy link
Member

@copilot Verify the controller in the admin panel and remove the restriction related to the store, because it has been moved to the store project.

Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Copy link
Author

Copilot AI commented Sep 22, 2025

@copilot Verify the controller in the admin panel and remove the restriction related to the store, because it has been moved to the store project.

I've removed all store restrictions from the Admin BlogController as requested. The changes include removing IsStoreManager checks, StaffStoreId assignments, and AccessToEntityByStore validations across all blog post and category management methods. The Admin area now has full access to all blog content while store-specific management remains in the Store area. Changes committed in 9664d85.

@Copilot Copilot AI changed the title Add Blog management functionality to Store area Add Blog management functionality to Store area and remove Admin store restrictions Sep 22, 2025
Copilot finished work on behalf of KrzysztofPajak September 22, 2025 18:12
@KrzysztofPajak
Copy link
Member

@copilot Add missing using in _ViewImports.cshtml
because there is a issue in src/Web/Grand.Web.Store/Areas/Store/Views/Blog/Partials/CreateOrUpdate.TabSeo.cshtml(2,8): Error CS0246: The type or namespace name 'BlogPostModel' could not be found (are you missing a using directive or an assembly reference?)

Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Copy link
Author

Copilot AI commented Sep 23, 2025

@copilot Add missing using in _ViewImports.cshtml
because there is a issue in src/Web/Grand.Web.Store/Areas/Store/Views/Blog/Partials/CreateOrUpdate.TabSeo.cshtml(2,8): Error CS0246: The type or name...

I've added the missing @using Grand.Web.AdminShared.Models.Blogs directive to the Store area's _ViewImports.cshtml file. This resolves the CS0246 compilation error where BlogPostModel could not be found in the CreateOrUpdate.TabSeo.cshtml file. The fix allows all Blog views in the Store area to properly reference Blog models. Changes committed in fede02c.

Copilot finished work on behalf of KrzysztofPajak September 23, 2025 18:01
@KrzysztofPajak
Copy link
Member

@copilot issue
src/Web/Grand.Web.Store/Controllers/BlogController.cs(76,69): Error CS1503: Argument 2: cannot convert from 'string' to 'System.DateTime?'

…oller

Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Copy link
Author

Copilot AI commented Sep 23, 2025

@copilot issue
src/Web/Grand.Web.Store/Controllers/BlogController.cs(76,69): Error CS1503: Argument 2: cannot convert from 'string' to 'System.DateTime?'

I've fixed the parameter mismatch in the GetAllBlogPosts method call. The issue was that I was passing an empty string "" as the second positional parameter, which was being interpreted as dateFrom (DateTime?) instead of blogPostName (string). I've updated the call to use named parameters: pageIndex: command.Page - 1, pageSize: command.PageSize which resolves the CS1503 compilation error. Changes committed in c7480d1.

Copilot finished work on behalf of KrzysztofPajak September 23, 2025 18:19
Copy link

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