Skip to content

Commit 0f28ae4

Browse files
ARCH-001 Phase 16: fix Comments(GET) 500 — redirect instead of rendering nonexistent view
Copilot review on PR #810: BaseNewsController.Comments(string) returned View() but no Comments.cshtml exists for News (unlike Blog, which has one). Preexisting bug carried over from Admin's original NewsController, verified against the merge-base. The GET action is unreachable via the UI — the Comments tab's grid calls the POST overload only — so redirect to List instead of leaving a dead View() call that 500s if ever hit directly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRztBQVfXimBPMFAioLabo
1 parent a6a35b9 commit 0f28ae4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/Web/Grand.Web.AdminShared/Controllers/BaseNewsController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ public async Task<IActionResult> Delete(string id)
171171

172172
#region Comments
173173

174-
public IActionResult Comments(string filterByNewsItemId)
175-
{
176-
ViewBag.FilterByNewsItemId = filterByNewsItemId;
177-
return View();
178-
}
174+
// Ruled fix (PR review): Admin's original returned View() here with no Comments.cshtml ever
175+
// existing for News (unlike Blog, which has one) - a preexisting 500 if this GET were ever hit
176+
// directly. Unreachable from the UI (the Comments tab's grid calls the POST overload only), so
177+
// redirect instead of carrying the dead View() call forward.
178+
public IActionResult Comments(string filterByNewsItemId) => RedirectToAction("List");
179179

180180
[PermissionAuthorizeAction(PermissionActionName.List)]
181181
[HttpPost]

0 commit comments

Comments
 (0)