{"record":{"id":"83dc2f49c089e612","repo":"nopSolutions/nopCommerce","slug":"no-checkout-attribute-value-found-with-the-specifi","errorCode":null,"errorMessage":"No checkout attribute value found with the specified id","messagePattern":"No checkout attribute value found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/CheckoutAttributeController.cs","lineNumber":486,"sourceCode":"            ViewBag.RefreshPage = true;\n\n            return View(model);\n        }\n\n        //prepare model\n        model = await _checkoutAttributeModelFactory.PrepareCheckoutAttributeValueModelAsync(model, checkoutAttribute, checkoutAttributeValue, true);\n\n        //if we got this far, something failed, redisplay form\n        return View(model);\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Catalog.CHECKOUT_ATTRIBUTES_CREATE_EDIT_DELETE)]\n    public virtual async Task<IActionResult> ValueDelete(int id)\n    {\n        //try to get a checkout attribute value with the specified id\n        var checkoutAttributeValue = await _checkoutAttributeService.GetAttributeValueByIdAsync(id)\n            ?? throw new ArgumentException(\"No checkout attribute value found with the specified id\", nameof(id));\n\n        await _checkoutAttributeService.DeleteAttributeValueAsync(checkoutAttributeValue);\n\n        return new NullJsonResult();\n    }\n\n    #endregion\n}","sourceCodeStart":468,"sourceCodeEnd":494,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/CheckoutAttributeController.cs#L468-L494","documentation":"Thrown by CheckoutAttributeController.ValueDelete (permission: CHECKOUT_ATTRIBUTES_CREATE_EDIT_DELETE). It fetches the checkout attribute value by id and throws ArgumentException if missing — the value was already deleted or the id is invalid.","triggerScenarios":"POST ValueDelete with an id absent from the DB — double delete, stale grid, or another admin removed the value first.","commonSituations":"Re-clicking delete on an already-removed value; concurrent edits to checkout attribute values; retention cleanup removing the row.","solutions":["Refresh the value grid and delete only rows that still appear.","Make ValueDelete idempotent (return success when the row is already gone).","Disable the delete control after first click and handle missing-row responses."],"exampleFix":"// before\nvar checkoutAttributeValue = await _checkoutAttributeService.GetAttributeValueByIdAsync(id)\n    ?? throw new ArgumentException(\"No checkout attribute value found with the specified id\", nameof(id));\n\n// after\nvar checkoutAttributeValue = await _checkoutAttributeService.GetAttributeValueByIdAsync(id);\nif (checkoutAttributeValue == null)\n    return new NullJsonResult();\n","handlingStrategy":"fallback","validationCode":"// Idempotent checkout attribute value delete.\nvar value = await _checkoutAttributeService.GetAttributeValueByIdAsync(id);\nif (value == null) return new NullJsonResult();","typeGuard":"static bool CheckoutAttributeValueExists(CheckoutAttributeValue v) => v is not null;","tryCatchPattern":"try { /* ValueDelete body */ }\ncatch (ArgumentException ex) when (ex.ParamName == nameof(id))\n{\n    return new NullJsonResult();\n}","preventionTips":["Refresh the value grid before deleting.","Make deletes idempotent.","Disable the delete control after first click."],"tags":["nopcommerce","admin","checkout-attribute","not-found","concurrency"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}