payload icon indicating copy to clipboard operation
payload copied to clipboard

Translating a model causes an issues with blocks component

Open mikemoooo opened this issue 3 years ago • 1 comments

Bug Report

When updating the content of a page in another locale, I have had the issue that within a blocks container an empty object is added. This causes the layout blocks to start counting at 2 and prevents adding new block. When trying to save the console shows the error: Uncaught TypeError: Cannot destructure property 'blockType' of as it is undefined.

The screenshot below shows the initial state after switching to the new locale. The issue can be fixed by updating the mongodb and removing the empty object.

Expected Behavior

When no content is translated for the block component, the component should be empty.

Detailed Description

Payload version: 1.0.30

SCR-20220901-qxe SCR-20220901-qxv

mikemoooo avatar Sep 01 '22 17:09 mikemoooo

Hey @mikemoooo, I attempted to recreate your issue, but I was unable to. Could you provide some more detail?

Here are the steps I performed:

  • On a collection with a localized block, Create new
  • Populate block for en
  • Save
  • Switch to es
  • Save without populating

Are these similar to the steps you performed to get this issue? If you can provide a slimmed down version of your collection config to recreate, that would also be helpful.

denolfe avatar Sep 07 '22 00:09 denolfe

@mikemoooo just checking in here for any possible reproduction steps as we can't reproduce the issue. I will convert this to a Discussion for now, and if we can replicate the issue, we will re-open accordingly.

Thank you!

jmikrut avatar Sep 19 '22 16:09 jmikrut