{"record":{"id":"ed6ecab6cd0a560f","repo":"nopSolutions/nopCommerce","slug":"no-product-review-found-with-the-specified-id","errorCode":null,"errorMessage":"No product review found with the specified id","messagePattern":"No product review found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/ProductReviewController.cs","lineNumber":304,"sourceCode":"        await _productReviewService.DeleteProductReviewsAsync(productReviews);\n\n        //activity log\n        var activityLogFormat = await _localizationService.GetResourceAsync(\"ActivityLog.DeleteProductReview\");\n        await _customerActivityService.InsertActivitiesAsync(\"DeleteProductReview\", productReviews, productReview => string.Format(activityLogFormat, productReview.Id));\n\n        //update product totals\n        foreach (var product in products)\n            await _productReviewService.UpdateProductReviewTotalsAsync(product);\n\n        return Json(new { Result = true });\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Catalog.PRODUCT_REVIEWS_VIEW)]\n    public virtual async Task<IActionResult> ProductReviewReviewTypeMappingList(ProductReviewReviewTypeMappingSearchModel searchModel)\n    {\n        var productReview = await _productReviewService.GetProductReviewByIdAsync(searchModel.ProductReviewId)\n            ?? throw new ArgumentException(\"No product review found with the specified id\");\n\n        //prepare model\n        var model = await _productReviewModelFactory.PrepareProductReviewReviewTypeMappingListModelAsync(searchModel, productReview);\n\n        return Json(model);\n    }\n\n    #endregion\n}","sourceCodeStart":286,"sourceCodeEnd":313,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/ProductReviewController.cs#L286-L313","documentation":"Thrown by ProductReviewReviewTypeMappingList (POST, PRODUCT_REVIEWS_VIEW) when GetProductReviewByIdAsync(searchModel.ProductReviewId) returns null. The sub-grid of review-type mappings cannot be built without the parent review, so the lookup failure aborts the model factory.","triggerScenarios":"The review-type-mapping sub-grid requests data for a ProductReviewId that was deleted (e.g. a moderated/disapproved review was purged); stale tab; tampered id; review removed between page load and sub-grid load.","commonSituations":"Bulk review moderation that deletes reviews while the detail view is open; restored DBs; concurrent admin moderation; URLs from cached pages.","solutions":["Reload the product-reviews list and open a current review before expanding its mappings.","Return an empty payload when the review is missing rather than surfacing a 500.","Avoid deleting reviews while their mapping sub-grids are loading.","Validate ProductReviewId > 0 before issuing the request."],"exampleFix":"// before\nvar productReview = await _productReviewService.GetProductReviewByIdAsync(searchModel.ProductReviewId)\n    ?? throw new ArgumentException(\"No product review found with the specified id\");\n\n// after\nvar productReview = await _productReviewService.GetProductReviewByIdAsync(searchModel.ProductReviewId);\nif (productReview == null)\n    return Json(new { Data = Enumerable.Empty<object>(), Total = 0 });","handlingStrategy":"validation","validationCode":"if (searchModel.ProductReviewId <= 0) return Json(empty);\nvar review = await _productReviewService.GetProductReviewByIdAsync(searchModel.ProductReviewId);\nif (review == null) return Json(empty);","typeGuard":"// N/A","tryCatchPattern":"catch (ArgumentException ex) when (ex.Message.Contains(\"No product review\"))\n{ return Json(new { Data = Array.Empty<object>(), Total = 0 }); }","preventionTips":["Validate ProductReviewId before requesting the mapping sub-grid.","Refresh the reviews list after moderation.","Avoid deleting reviews while their sub-grids load."],"tags":["nopcommerce","admin-controller","not-found","product-review","list-endpoint"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}