You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the Contenful Migration CLI 'deriveLinkedEntries' script to add an existing content model 'seo' as a reference within another existing content model 'pageBlogPost'.
Actual Behavior
Migration fails for some entries with 400 and 422 errors.
Steps to Reproduce
Create a new seo field in the blog post content type as a reference content type SEO.
module.exports=function(migration){// Create a new seo field in the blog post content type.constblogPost=migration.editContentType('pageBlogPost')blogPost.createField('seo_ref').name('Compose: SEO').type('Link').linkType('Entry').validations([{linkContentType: ['seo'],},])}
Edit each blog entries new seo_ref field using existing fields in blogs such as 'metaTitle', 'metaDescription', etc.
module.exports=function(migration){migration.deriveLinkedEntries({// Start from blog post's meta fieldcontentType: 'pageBlogPost',from: ['metaTitle','metaDescription','slug'],// This is the field we created in 01-add-seo-ref.js, which will hold the link to the derived category entries.toReferenceField: 'seo_ref',// The new entries to create are of type 'category'.derivedContentType: 'seo',derivedFields: ['title','description'],identityKey: async(from)=>{// The category name will be used as an identity key.returnfrom.slug['en-US']},deriveEntryForLocale: async(from,locale)=>{if(locale!=='en-US'){return}return{title: from['metaTitle'][locale],description: from['metaDescription'][locale],}},})}
Context
We have two existing content models 'pageBlogPost' and 'seo'. I'm trying to add 'seo' as a reference field into the 'pageBlogPost' and modify each blog entries 'seo' fields such as 'title' and 'description' with existing blog fields such as 'metaTitle' and 'metaDescription'.
This script succeeds for the majority of entries but fails overall due to a few of them erring. See errors below.
Errors
Operating System: Darwin MREM5C7EE61C 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:43:09 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T6000 arm64
Expected Behavior
Using the Contenful Migration CLI 'deriveLinkedEntries' script to add an existing content model 'seo' as a reference within another existing content model 'pageBlogPost'.
Actual Behavior
Migration fails for some entries with 400 and 422 errors.
Steps to Reproduce
Context
We have two existing content models 'pageBlogPost' and 'seo'. I'm trying to add 'seo' as a reference field into the 'pageBlogPost' and modify each blog entries 'seo' fields such as 'title' and 'description' with existing blog fields such as 'metaTitle' and 'metaDescription'.
This script succeeds for the majority of entries but fails overall due to a few of them erring. See errors below.
Errors
Environment
The text was updated successfully, but these errors were encountered: