zesty-io / manager-ui

Content platform powering enterprise websites and applications
https://www.zesty.io
Other
39 stars 5 forks source link

Content: Cannot Create a New Item Once a Field's API ID is updated #2440

Closed zcolah closed 7 months ago

zcolah commented 8 months ago

Describe the bug

  1. I cannot create an item, if I update the Field API ID. Please see Loom for more context: https://www.loom.com/share/11760952f69f4db485541a4c90b44beb
  2. Here is another Loom showing how I am stuck and unable to get out of the bad state: https://www.loom.com/share/ffeb4d62564c432bb36bb767fadfee6c?from_recorder=1&focus_title=1
  3. Create Content Item Page: https://8-da92b5d8e6-hvp4w4.manager.zesty.io/content/6-8ed3fbd5fb-5n4cvt/new
  4. Model: https://8-da92b5d8e6-hvp4w4.manager.zesty.io/schema/6-8ed3fbd5fb-5n4cvt/fields
ardeay commented 8 months ago

@agalin920 could this be due to the model fields not being refreshing in local cache when a field item is changed?

agalin920 commented 8 months ago

Please provide replication steps

agalin920 commented 8 months ago

Reproduction steps.

  1. create a new multi page content item
  2. do not save it and leave as 'draft'
  3. edit its respective model
  4. go back to the unsaved draft (that is saved in local memory)
  5. Draft was created using old model so it fails upon creation

This edge case relates to the fact that upon creating a content item it is 'drafted' in local storage with the model as the template. When editing a model and coming back to the draft, the draft still has key:value pairs pertaining to the old model

Solution:

Remove key:value pairs that are no longer present in the model

@ardeay ^