You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional context
The configuration does not work because the block id that is passed to the _applyBlockInitialValue function is the id of the previous block, and not the id of the newly created block. See:
The id passed there should be newBlockId and not id.
Even making this fix, one thing that still happens is that when the previous one is a block of text, the setting is not applied. The insertBlock method is not called in this situation. I wouldn't know where to call _applyBlockInitialValue in this situation. I know that the changeBlock method is called in this situation. But I don't know if it would be the right place, since it is called several times.
The text was updated successfully, but these errors were encountered:
In fact, insertBlock is not called if the previous block is an empty text block. If the text block is not empty, insertBlock is called.
The difference between adding a block after any block and after a empty text block is here:
Describe the bug
initialValue block setting doesn't work.
To Reproduce
Steps to reproduce the behavior:
initialValue
setting. For example:myField
field is not filled with the value 'test'.Expected behavior
The myField field should be filled with the value 'test'.
Software (please complete the following information):
Volto 18.0.0-alpha.27
Plone 6.0.10
plone.restapi 9.5.0
Additional context
The configuration does not work because the block id that is passed to the
_applyBlockInitialValue
function is the id of the previous block, and not the id of the newly created block. See:volto/packages/volto/src/helpers/Blocks/Blocks.js
Line 307 in 0edcd80
The id passed there should be
newBlockId
and notid
.Even making this fix, one thing that still happens is that when the previous one is a block of text, the setting is not applied. The insertBlock method is not called in this situation. I wouldn't know where to call
_applyBlockInitialValue
in this situation. I know that the changeBlock method is called in this situation. But I don't know if it would be the right place, since it is called several times.The text was updated successfully, but these errors were encountered: