Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Bug when adding defaultValue to a field and widget to the sidebar #259

Open
gjorgji-dept opened this issue Apr 1, 2022 · 0 comments
Open

Comments

@gjorgji-dept
Copy link

gjorgji-dept commented Apr 1, 2022

Hi,

Running migrations with this package throws errors and causes bugs that started a couple of days ago. Namely, doing this

const model = migration.editContentType("contentTypeId");

model.createField("fieldId")
  .name("Field name")
  .type("Integer")
  .defaultValue({
    [locale]: value,
  })

causes scripts to fail with the following error:
"defaultValue" is not a valid property name for a field.

When adding a widget to the sidebar with the following code, it adds the widget, but it removes all of the other (native) widgets

const model = migration.editContentType("contentTypeId");

model.addSidebarWidget(
  "app",
  "widgetId",
  {},
  "publication-widget"
);

Using the native contentful-migration package it executes both scripts without any issues, but when using ctf-migrate to do the migrations, the aforementioned bugs and errors occur.

Package versions:
"contentful": "^9.1.18",
"contentful-migrate": "^0.16.0",
"contentful-cli": "^1.12.8",
"contentful-migration": "^4.0.0"

Updating the packages still doesn't resolve the issue and if anything, it further breaks the whole set up.
I appreciate any help resolving this issue.

P.S. #224 might be the reason why it started failing only recently.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant