{"record":{"id":"944fde803f296033","repo":"nopSolutions/nopCommerce","slug":"no-comment-found-with-the-specified-id-944fde","errorCode":null,"errorMessage":"No comment found with the specified id","messagePattern":"No comment found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/BlogController.cs","lineNumber":240,"sourceCode":"    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.ContentManagement.BLOG_COMMENTS_VIEW)]\n    public virtual async Task<IActionResult> Comments(BlogCommentSearchModel searchModel)\n    {\n        //prepare model\n        var model = await _blogModelFactory.PrepareBlogCommentListModelAsync(searchModel, searchModel.BlogPostId);\n\n        return Json(model);\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.ContentManagement.BLOG_COMMENTS_CREATE_EDIT_DELETE)]\n    public virtual async Task<IActionResult> CommentUpdate(BlogCommentModel model)\n    {\n        //try to get a blog comment with the specified id\n        var comment = await _blogService.GetBlogCommentByIdAsync(model.Id)\n            ?? throw new ArgumentException(\"No comment found with the specified id\");\n\n        var previousIsApproved = comment.IsApproved;\n\n        //fill entity from model\n        comment = model.ToEntity(comment);\n\n        await _blogService.UpdateBlogCommentAsync(comment);\n\n        //raise event (only if it wasn't approved before and is approved now)\n        if (!previousIsApproved && comment.IsApproved)\n            await _eventPublisher.PublishAsync(new BlogCommentApprovedEvent(comment));\n\n        //activity log\n        await _customerActivityService.InsertActivityAsync(\"EditBlogComment\",\n            string.Format(await _localizationService.GetResourceAsync(\"ActivityLog.EditBlogComment\"), comment.Id), comment);\n\n        return new NullJsonResult();\n    }","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/BlogController.cs#L222-L258","documentation":"Thrown by BlogController.CommentUpdate (permission: BLOG_COMMENTS_CREATE_EDIT_DELETE). It loads the blog comment by model.Id and throws ArgumentException if missing — the comment was deleted, unapproved-and-purged, or the id is invalid before an update.","triggerScenarios":"POST CommentUpdate with a model.Id that GetBlogCommentByIdAsync cannot find: another admin deleted the comment, or the grid row is stale after moderation action.","commonSituations":"Concurrent moderation; inline-edit a comment that was just removed; spam cleanup job purging the row mid-edit.","solutions":["Refresh the blog comment grid and re-attempt the edit on an existing row.","Have the update action return NotFound/Json error instead of throwing on a missing comment.","On the client, surface 'record no longer exists' to the user instead of a 500."],"exampleFix":"// before\nvar comment = await _blogService.GetBlogCommentByIdAsync(model.Id)\n    ?? throw new ArgumentException(\"No comment found with the specified id\");\n\n// after\nvar comment = await _blogService.GetBlogCommentByIdAsync(model.Id);\nif (comment == null)\n    return NotFound($\"Blog comment {model.Id} no longer exists.\");\n","handlingStrategy":"validation","validationCode":"// Confirm the comment still exists before applying the update.\nvar comment = await _blogService.GetBlogCommentByIdAsync(model.Id);\nif (comment == null) return NotFound($\"Blog comment {model.Id} no longer exists.\");","typeGuard":"static bool BlogCommentExists(BlogComment c) => c is not null;","tryCatchPattern":"try { /* CommentUpdate body */ }\ncatch (ArgumentException)\n{\n    return NotFound($\"Blog comment {model.Id} no longer exists.\");\n}","preventionTips":["Refresh the comment grid before inline-editing.","Surface 'record changed' to the user on the client.","Coordinate moderation to avoid concurrent edits."],"tags":["nopcommerce","admin","blog","comment","not-found","concurrency"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}