Skip to content
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

Copying block items from newly created content overrides eachother #14459

Closed
nikcio opened this issue Jun 26, 2023 · 3 comments · Fixed by #14464
Closed

Copying block items from newly created content overrides eachother #14459

nikcio opened this issue Jun 26, 2023 · 3 comments · Fixed by #14464

Comments

@nikcio
Copy link
Contributor

nikcio commented Jun 26, 2023

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

8.15.0 & 11.4.0

Bug summary

When creating new content with block lists you can encounter that when trying to copy block list items the items will override each other so that you can only paste the last copied item.

Note: This might also be the case with block grid. I haven't tested it.

Specifics

The error occurs in this piece of code where the first copied selection is overridden by the new one. This happens because uniqueKey here always will be 0.

// remove previous copies of this entry:
storage.entries = storage.entries.filter(
(entry) => {
return entry.unique !== uniqueKey;
}
);

Steps to reproduce

Version 1

  1. Create a content type with a block list
  2. Create a new document where you add some item to the block list
  3. Press the copy function (You now have a copy where the uniqueKey is 0)

image
image

  1. Close the document and discard the changes.
  2. Create a new document where you add something else to the block list
  3. Press the copy function (You have now overridden the previous copy)

image
image

  1. Try to paste your selection. You will now only have 1 option instead of the expected 2 you copied.

Version 2:

  1. Create a content type with two block lists that can vary by culture (min. 2 languages)
  2. Create a new document where you add some items to block list 1 and then copy
  3. Add some items to block list 2 and then copy that
  4. Switch to the other language and try to paste the values into the block lists. You'll find that you can only paste in one of the fields.

Expected result / actual result

I expected that you could copy the block list values even when creating the document.

@github-actions
Copy link

Hi there @nikcio!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@kjac
Copy link
Contributor

kjac commented Jun 27, 2023

Hi @nikcio,

Thanks for reporting 👍 I can reproduce this.

Just to clarify - this does not happen when copying individual blocks, only when copying all blocks using the property action (as illustrated in the original issue description). This also only happens when copying blocks from new, unsaved content.

It should be possible to fix this by testing if uniqueKey has a value in the referenced code snippet.

I'm putting this up for grabs if anyone would like to have a crack at it 😄

@github-actions
Copy link

Hi @nikcio,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post.

Thanks muchly, from your friendly Umbraco GitHub bot :-)

nikcio added a commit to nikcio/Umbraco-CMS that referenced this issue Jun 27, 2023
nul800sebastiaan pushed a commit that referenced this issue Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants