{"record":{"id":"d0af145eb3d3f1e2","repo":"nopSolutions/nopCommerce","slug":"no-checkout-attribute-found-with-the-specified-id","errorCode":null,"errorMessage":"No checkout attribute found with the specified id","messagePattern":"No checkout attribute found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/CheckoutAttributeController.cs","lineNumber":337,"sourceCode":"\n        //activity log\n        var activityLogFormat = await _localizationService.GetResourceAsync(\"ActivityLog.DeleteCheckoutAttribute\");\n        await _customerActivityService.InsertActivitiesAsync(\"DeleteCheckoutAttribute\", checkoutAttributes, checkoutAttribute => string.Format(activityLogFormat, checkoutAttribute.Name));\n\n        return Json(new { Result = true });\n    }\n\n    #endregion\n\n    #region Checkout attribute values\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Catalog.CHECKOUT_ATTRIBUTES_VIEW)]\n    public virtual async Task<IActionResult> ValueList(CheckoutAttributeValueSearchModel searchModel)\n    {\n        //try to get a checkout attribute with the specified id\n        var checkoutAttribute = await _checkoutAttributeService.GetAttributeByIdAsync(searchModel.CheckoutAttributeId)\n            ?? throw new ArgumentException(\"No checkout attribute found with the specified id\");\n\n        //prepare model\n        var model = await _checkoutAttributeModelFactory.PrepareCheckoutAttributeValueListModelAsync(searchModel, checkoutAttribute);\n\n        return Json(model);\n    }\n\n    [CheckPermission(StandardPermission.Catalog.CHECKOUT_ATTRIBUTES_CREATE_EDIT_DELETE)]\n    public virtual async Task<IActionResult> ValueCreatePopup(int checkoutAttributeId)\n    {\n        //try to get a checkout attribute with the specified id\n        var checkoutAttribute = await _checkoutAttributeService.GetAttributeByIdAsync(checkoutAttributeId);\n        if (checkoutAttribute == null)\n            return RedirectToAction(\"List\");\n\n        //prepare model\n        var model = await _checkoutAttributeModelFactory\n            .PrepareCheckoutAttributeValueModelAsync(new CheckoutAttributeValueModel(), checkoutAttribute, null);","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/CheckoutAttributeController.cs#L319-L355","documentation":"Thrown by CheckoutAttributeController.ValueList (permission: CHECKOUT_ATTRIBUTES_VIEW). The value-grid datasource loads the parent checkout attribute by searchModel.CheckoutAttributeId and throws ArgumentException if missing. The parent attribute was deleted or the id is invalid.","triggerScenarios":"POST ValueList with a CheckoutAttributeId that GetAttributeByIdAsync cannot find — parent attribute removed while its values tab was open, or a stale id.","commonSituations":"Concurrent attribute management; deleting a checkout attribute in one tab while its value grid is mounted in another; cached client state.","solutions":["Reopen the checkout attributes list and pick a current attribute before listing its values.","Return an empty value list instead of throwing when the parent attribute is missing.","Verify the grid posts the correct CheckoutAttributeId after navigation."],"exampleFix":"// before\nvar checkoutAttribute = await _checkoutAttributeService.GetAttributeByIdAsync(searchModel.CheckoutAttributeId)\n    ?? throw new ArgumentException(\"No checkout attribute found with the specified id\");\n\n// after\nvar checkoutAttribute = await _checkoutAttributeService.GetAttributeByIdAsync(searchModel.CheckoutAttributeId);\nif (checkoutAttribute == null)\n    return Json(new CheckoutAttributeValueListModel());\n","handlingStrategy":"validation","validationCode":"// Validate parent checkout attribute before listing values.\nvar attr = await _checkoutAttributeService.GetAttributeByIdAsync(searchModel.CheckoutAttributeId);\nif (attr == null) return Json(new CheckoutAttributeValueListModel());","typeGuard":"static bool CheckoutAttributeExists(CheckoutAttribute a) => a is not null;","tryCatchPattern":"try { /* ValueList body */ }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"checkout attribute\"))\n{\n    return Json(new CheckoutAttributeValueListModel());\n}","preventionTips":["Reopen the checkout attributes list before opening a value grid.","Return an empty grid for a missing parent.","Don't delete a parent attribute while its tab is open."],"tags":["nopcommerce","admin","checkout-attribute","not-found","stale-ui"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}