{"record":{"id":"00f54cdd447ca1f0","repo":"nopSolutions/nopCommerce","slug":"no-product-attribute-combination-found-with-the-sp","errorCode":null,"errorMessage":"No product attribute combination found with the specified id","messagePattern":"No product attribute combination found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/ProductController.cs","lineNumber":3794,"sourceCode":"\n        //a vendor should have access only to his products\n        var currentVendor = await _workContext.GetCurrentVendorAsync();\n        if (currentVendor != null && product.VendorId != currentVendor.Id)\n            return Content(\"This is not your product\");\n\n        //prepare model\n        var model = await _productModelFactory.PrepareProductAttributeCombinationListModelAsync(searchModel, product);\n\n        return Json(model);\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Catalog.PRODUCTS_CREATE_EDIT_DELETE)]\n    public virtual async Task<IActionResult> ProductAttributeCombinationDelete(int id)\n    {\n        //try to get a combination with the specified id\n        var combination = await _productAttributeService.GetProductAttributeCombinationByIdAsync(id)\n            ?? throw new ArgumentException(\"No product attribute combination found with the specified id\");\n\n        //try to get a product with the specified id\n        var product = await _productService.GetProductByIdAsync(combination.ProductId)\n            ?? throw new ArgumentException(\"No product found with the specified id\");\n\n        //a vendor should have access only to his products\n        var currentVendor = await _workContext.GetCurrentVendorAsync();\n        if (currentVendor != null && product.VendorId != currentVendor.Id)\n            return Content(\"This is not your product\");\n\n        await _productAttributeService.DeleteProductAttributeCombinationAsync(combination);\n\n        return new NullJsonResult();\n    }\n\n    [CheckPermission(StandardPermission.Catalog.PRODUCTS_CREATE_EDIT_DELETE)]\n    public virtual async Task<IActionResult> ProductAttributeCombinationCreatePopup(int productId)\n    {","sourceCodeStart":3776,"sourceCodeEnd":3812,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/ProductController.cs#L3776-L3812","documentation":"First stage of ProductAttributeCombinationDelete (POST): GetProductAttributeCombinationByIdAsync(id) returns null. The combination id must identify an existing ProductAttributeCombination row; otherwise the delete cannot proceed and the action throws ArgumentException before loading the owning product.","triggerScenarios":"Posting a delete for an already-removed combination; double-click on the delete button where the first call succeeds; tampered grid row id; combination removed by an automatic regeneration of attribute combinations.","commonSituations":"User clicks delete twice; another admin regenerates combinations (GenerateAllAttributeCombinations) which clears prior ones; restored DB lacking the referenced row.","solutions":["Refresh the combinations grid and confirm the row still exists before deleting.","Guard against double-submission on the delete button (disable after first click).","Avoid regenerating combinations concurrently with manual deletes.","Verify the id from the request matches a current combination via a preflight lookup."],"exampleFix":"// before\nvar combination = await _productAttributeService.GetProductAttributeCombinationByIdAsync(id)\n    ?? throw new ArgumentException(\"No product attribute combination found with the specified id\");\n\n// after\nvar combination = await _productAttributeService.GetProductAttributeCombinationByIdAsync(id);\nif (combination == null)\n    return new NullJsonResult(); // already gone - idempotent success","handlingStrategy":"validation","validationCode":"var combination = await _productAttributeService.GetProductAttributeCombinationByIdAsync(id);\nif (combination == null) return new NullJsonResult(); // idempotent","typeGuard":"// N/A","tryCatchPattern":"catch (ArgumentException ex) when (ex.Message.Contains(\"No product attribute combination\"))\n{ return new NullJsonResult(); }","preventionTips":["Make combination deletes idempotent (missing = success).","Prevent double-click on the delete button.","Refresh the combinations grid before deleting after a regeneration."],"tags":["nopcommerce","admin-controller","not-found","product-attribute-combination","delete"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}