-
-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple listing blocks: Rendering fails for copy-pasted listing blocks #4234
Comments
Problem is, that for the rendering, the block id included in content.blocks[blockid] is used. This is the same for original and copy. :-( |
Question here: Why is the block id included in content.blocks[blockid] at all? It's redundant and raises an error when duplicating listing blocks. |
I would like to modify the copy change action instead of eliminating the block id. Eliminating the redundant block id would mean a breaking change. Example for page with duplicated and modified listing blocks:
|
@ksuess Maybe we need to define a volto/src/components/manage/Form/BlocksToolbar.jsx Lines 96 to 99 in a7e3e08
|
@tiberiuichim The responsibility to fix of data.block could be forwarded to blockConfig.cloneData. But I think it must be done in any case, so I think the fix can be done after blockConfig.cloneData / default cloning. |
@ksuess I'm not sure I understand your fix. The block id doesn't belong together with the block data, so my idea for a fix would be to make sure that the listing block always generates a new block id, in its cloneData method. |
@tiberiuichim What I don't see, why the blocks data has a block attribute.
|
Just to be clear, every block always has a UUID. A listing block has an additional attribute of
|
Yes, exactly, that's what I stumbled upon. Would like to understand the need for the |
I think having the data.block uid stored in the block data is a bug. The block's UID should not be stored in the data. It probably got there by wrongly spreading some props into the data. |
I can see that it's specifically inserted here:
Why?! |
@ksuess the useEffect from volto/src/components/manage/Blocks/Listing/Edit.jsx Lines 33 to 42 in a7e3e08
|
Well now data.block uid can be removed from listing block. I finally found a way to modify |
I saw. Awesome! |
I don't recall now why the listing block is persisting the |
To Reproduce
Software (please complete the following information):
Current Volto
The text was updated successfully, but these errors were encountered: