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
{{ message }}
Repository navigation
New Splitting unification duplicates empty content blocks if a json attribute is present. #64071
We have a content block which users were traditionally able to paste blocks into and it would replace itself with the pasted blocks, similar to how core/paragraph works.
Since 6.6, it not longer does only this. Now, the pasted block is sandwiched between the content blocks.
This appears to be due to the fact that these content blocks get some abstract attribute data set one way or another, and the splitting logic assumes that these blocks therefore are "splittable", when the only attribute it should be paying attention to with that regard is the content attribute (or whatever else we've named it).
I can also safely replicate this with the core/paragraph block (albeit through some code editor magic), so it's not isolated to our code.
This probably isn't that noticeable in core, maybe, but considering the fact that I'm able to replicate this with the core "metadata" attribute filled out might mean future complications.
I'm assuming this is caused by the split logic refactor #54543, though I can't pin down what specifically is the cause. I am worried that I can observe non-content attributes being duplicated implicitly, particular where unique attributes are concerned, such as anchors (obviously some stuff makes sense to include, but if there's no content to split...)
Step-by-step reproduction instructions
create a new post, and enter the "code editor" view
@ellatrix more or less just the "should i split or should i replace."
i have no opinions on whether metadata attribute should be copied or not as I'm not intimate with its usage or intended purpose in the grand scheme of things.
some level of configuration of what attributes should be copied over or should be treated as "unique" on block creation/duplication would be cool, but i don't see that as being part of the issue here.
Activity
ellatrix commentedon Oct 21, 2024
I can also reproduce this when you have an aligned paragraph with no content, then paste something in it.
So there's two issues you're raising here I think?
metadatashould not be copied.Or did you only mean to raise one? Did I misinterpret anything?
albanyacademy commentedon Dec 5, 2024
@ellatrix more or less just the "should i split or should i replace."
i have no opinions on whether metadata attribute should be copied or not as I'm not intimate with its usage or intended purpose in the grand scheme of things.
some level of configuration of what attributes should be copied over or should be treated as "unique" on block creation/duplication would be cool, but i don't see that as being part of the issue here.
Mamaduka commentedon Dec 10, 2025
I think using the same method as in #70897 could fix this. Check for modifications to the
contentrole attributes.