{"record":{"id":"535214aadad0b948","repo":"nopSolutions/nopCommerce","slug":"no-contact-form-attribute-value-found-with-the-spe","errorCode":null,"errorMessage":"No contact form attribute value found with the specified id","messagePattern":"No contact form attribute value found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/ContactFormAttributeController.cs","lineNumber":326,"sourceCode":"\n            ViewBag.RefreshPage = true;\n\n            return View(model);\n        }\n\n        //prepare model\n        model = await _contactFormAttributeModelFactory.PrepareContactFormAttributeValueModelAsync(model, contactFormAttribute, contactFormAttributeValue, true);\n\n        //if we got this far, something failed, redisplay form\n        return View(model);\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Configuration.MANAGE_SETTINGS)]\n    public virtual async Task<IActionResult> ValueDelete(int id)\n    {\n        var contactFormAttributeValue = await _contactFormAttributeService.GetAttributeValueByIdAsync(id)\n            ?? throw new ArgumentException(\"No contact form attribute value found with the specified id\", nameof(id));\n\n        await _contactFormAttributeService.DeleteAttributeValueAsync(contactFormAttributeValue);\n\n        //activity log\n        await _customerActivityService.InsertActivityAsync(\"DeleteContactFormAttributeValue\",\n            string.Format(await _localizationService.GetResourceAsync(\"ActivityLog.DeleteContactFormAttributeValue\"), contactFormAttributeValue.Id),\n            contactFormAttributeValue);\n\n        return new NullJsonResult();\n    }\n\n    #endregion\n}","sourceCodeStart":308,"sourceCodeEnd":339,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/ContactFormAttributeController.cs#L308-L339","documentation":"Thrown by ContactFormAttributeController.ValueDelete (permission: MANAGE_SETTINGS). It fetches the contact-form 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 — duplicate delete click, stale grid after a prior delete, or another admin removed the value first.","commonSituations":"Re-clicking delete on an already-removed value; concurrent edits to contact-form 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 gracefully."],"exampleFix":"// before\nvar contactFormAttributeValue = await _contactFormAttributeService.GetAttributeValueByIdAsync(id)\n    ?? throw new ArgumentException(\"No contact form attribute value found with the specified id\", nameof(id));\n\n// after\nvar contactFormAttributeValue = await _contactFormAttributeService.GetAttributeValueByIdAsync(id);\nif (contactFormAttributeValue == null)\n    return new NullJsonResult();\n","handlingStrategy":"fallback","validationCode":"// Idempotent contact-form attribute value delete.\nvar value = await _contactFormAttributeService.GetAttributeValueByIdAsync(id);\nif (value == null) return new NullJsonResult();","typeGuard":"static bool ContactFormAttributeValueExists(ContactFormAttributeValue 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","contact-form-attribute","not-found","concurrency"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}