Closed cachrisman closed 5 years ago
Thank you for reporting this. I haven't encountered this before, and am wondering now how this could have happened? Can you please provide an example of model to debug? Is Contentful keeping references to the non-existing model?
Also, PR is more then welcome and appreciated! :)
Thanks!
Here is an example content model:
https://gist.github.com/cachrisman/f641b8988c328582878f56f6138a43a7
or see this image
Now imagine I delete the series
content type and add a new content type called show
which does exactly the same thing as series. Essentially I've renamed series
to show
. Here is an updated content model
https://gist.github.com/cachrisman/0b550dffef61ba5e4fed81d91f5c2626
Hey @cachrisman terribly sorry for the slightly delayed reply .. I think I've slept for a year :)
Anyways, the issue has been solved in a recent commit https://github.com/lotas/contentful-graph/commit/eab85ea1b8a87b1b5602ed472db5bf3fb3390b79 and a new version was published 1.2.0
Thank you once again for the detailed bug report, attached model helped.
I also added support to run against local file, without even using contentful API.
npx contentful-graph ./your-model.json
which does the same locally.
If this is still relevant, please check, if not, sorry for the delayed response. Cheers
Consider the example of a content type which has a multiple reference field and that field has a validation to only accept entries of certain content types with the ids:
series
,season
,video
. The model has since changed andseries
has been deleted and replaced withshow
. The validation on that multiple reference field is now invalid.When I use this tool in the above mentioned situation I get
I think this tool could deal with that invalid reference by either labeling it as invalid (with the benefit of alerting the user to this error) or by excluding it quietly.
Happy to provide a PR with a fix.