{"record":{"id":"3e20ce20558489da","repo":"OrchardCMS/OrchardCore","slug":"defaultcontentmanager","errorCode":null,"errorMessage":", ","messagePattern":", ","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"src/OrchardCore/OrchardCore.ContentManagement/DefaultContentManager.cs","lineNumber":745,"sourceCode":"                }\n\n                if (originalVersion == null)\n                {\n                    // The version does not exist in the current database.\n                    var context = new ImportContentContext(importingItem);\n\n                    await Handlers.InvokeAsync((handler, context) => handler.ImportingAsync(context), context, _logger);\n\n                    var evictionVersions = versionsThatMaybeEvicted.Where(x => string.Equals(x.ContentItemId, importingItem.ContentItemId, StringComparison.OrdinalIgnoreCase));\n                    var result = await CreateContentItemVersionAsync(importingItem, evictionVersions);\n                    if (!result.Succeeded)\n                    {\n                        if (_logger.IsEnabled(LogLevel.Error))\n                        {\n                            _logger.LogError(\"Error importing content item version id '{ContentItemVersionId}' : '{Errors}'\", importingItem?.ContentItemVersionId, string.Join(\", \", result.Errors));\n                        }\n\n                        throw new ValidationException(string.Join(\", \", result.Errors));\n                    }\n\n                    // Imported handlers will only be fired if the validation has been successful.\n                    // Consumers should implement validated handlers to alter the success of that operation.\n                    await ReversedHandlers.InvokeAsync((handler, context) => handler.ImportedAsync(context), context, _logger);\n\n                    importedContentItems.Add(importingItem);\n                }\n                else\n                {\n                    // The version exists in the database.\n                    // It is important to only import changed items.\n                    // We compare the two versions and skip importing it if they are the same.\n                    // We do this to prevent unnecessary sql updates, and because UpdateContentItemVersionAsync\n                    // may remove drafts of updated items.\n                    // This is necessary because an imported item maybe set to latest, and published.\n                    // In this case, the draft item in the system, must be removed, or there will be two drafts.\n                    // The draft item should be removed, because it would now be orphaned, as the imported published item","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore/OrchardCore.ContentManagement/DefaultContentManager.cs#L727-L763","documentation":"ImportAsync validates each imported content item version; when validation fails, all errors are logged and rethrown as a ValidationException whose message is all errors joined with ', '. The bracketed 'message' here is that join separator — the actual message contains the validation error texts.","triggerScenarios":"Calling ImportAsync with a content item that fails handler validation (e.g., missing required parts, invalid values), producing one or more errors in result.Errors.","commonSituations":"Importing recipes/JSON exported from a different site version; missing content type/field definitions on the target site; duplicate ContentItemVersionIds in the import batch.","solutions":["Inspect the joined ValidationException message and the log entry for the specific errors","Ensure target site has the required features/content definitions enabled before import","Fix the source JSON (required fields, valid types) and re-run the import","Import in dependency order (types/parts before content items)"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"bool hasDefinition = await cm.GetContentDefinitionManager().GetTypeDefinition(item.ContentType) is not null;","typeGuard":null,"tryCatchPattern":"try { await cm.ImportAsync(items, results); } catch (ValidationException ex) { foreach (var e in ex.Errors) { /* surface per-field message */ } }","preventionTips":["Enable required features before importing","Match source/target Orchard versions","Import definitions before content","Validate imported JSON against target schema"],"tags":["import","validation","content"],"backgroundTag":"schema-validation-failed","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}