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

Blocklist - Duplication issues with Content Templates #13901

Closed
jerpenol opened this issue Mar 1, 2023 · 2 comments
Closed

Blocklist - Duplication issues with Content Templates #13901

jerpenol opened this issue Mar 1, 2023 · 2 comments
Labels

Comments

@jerpenol
Copy link

jerpenol commented Mar 1, 2023

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

8.17.0 and 11.1.0

Bug summary

We encountered a weird issue when using Content Templates containing BlockLists, where a newly created page (created with the Content Template) did not display the content of the block within the BlockList, but displayed the content of a block of another page. The other page being the page from which the Content Template was created.

Upon further inspection we noticed that when we open the Network window and inspect the response of the GetById call, that the Udi of the block was the same as the Udi of the block on the other page.

To further inspect the problem I tried the following:

  1. Create a new node with a block in the blocklist
  2. Create a copy of this node with "Relate to Original" being false
  3. Create a copy of this node with "Relate to Original" being true
  4. Create a new node and copy/pasted the entire blocklist from the original
  5. Reuse the node created in 4 but copy/pasted the single block value to the new blocklist
  6. Create a Content Template of the original and create a new node based on it

These tests resulted in the following Udi's for the block in the blocklist:

  1. Original = 96019e7d69bc4fc7972a0f57fead6124
  2. Unrelated Copy = e87f33d9bfc04d0eabba702c563f93ff
  3. Related Copy = a79177ccc71d452cb1ba67c4bf8852ad
  4. Copied BlockList = 98f209d954b2490a9ff08b7091a42da4
  5. Copied Block = 77b0158b69884d7083877cf8b86dbe64
  6. Content Template = 96019e7d69bc4fc7972a0f57fead6124

As you can see when using the Content Template the Udi of the block remains the same as the original node the content template was based on. This causes the new node (created in step 6) to display the block values of the block in the original node.

Specifics

This issue occurred on a website running on 11.1.0 in all browsers. I then tested this on another site using BlockLists which ran on 8.17.0. Both websites displayed the same issue.

Steps to reproduce

  1. Create a new Content Type called "MyPage"
    • Make sure the Content Type is created with a view
  2. Create a new Content Type called "MyBlock"
    • Set "Is an Element Type" under the "Permissions" tab to true
  3. Add a property to "MyBlock" called "Text"
    • Editor: Textstring
  4. Create a new Data Type called "MyBlockList"
    • Property editor: Block List
    • Available blocks: "MyBlock"
  5. Add a property called "BlockList" to the "MyPage" Content Type
    • Editor: MyBlockList
  6. Render the text property of the blocks in "BlockList" in the "MyPage.cshtml" view
  7. Create and Publish a node of type "MyPage" called "Duplication Test - Original"
    • Add a block to the "BlockList" property and fill in the "Text" property with "Original Text"
  8. Create a Content Template based on "Duplication Test - Original" and call it "Duplication Test Template"
  9. Create a node of type "MyPage" based on the "Duplication Test Template" Content Template and call it "Duplication Test - Copy"
  10. Open the prefilled block in the "BlockList" property of the newly created "Duplication Test - Copy"
  11. Change the "Text" property to "Copy Text"
  12. Publish "Duplication Test - Copy"
  13. Navigate to the front-end of "Duplication Test - Original" and to "Duplication Test - Copy" in another tab

Expected result / actual result

Expected
Front-end: "Duplication Test - Original" should display "Original Text" and "Duplication Test - Copy" should display "Copy Text".
Backoffice: If you inspect the GetById call in the network tab when opening "Duplication Test - Copy" the block Udi should be different from the block Udi of "Duplication Test - Original".

Actual
Front-end: "Duplication Test - Original" displays "Original Text" and "Duplication Test - Copy" displays "Original Text" aswel.
Backoffice: If you inspect the GetById call in the network tab when opening "Duplication Test - Copy" the block Udi is the same as the block Udi of "Duplication Test - Original".

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

Hi there @jerpenol!

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 🤖 🙂

@nikolajlauridsen
Copy link
Contributor

Heya, thanks for the very detailed description, that's always appreciated.

However, this seems to be a duplicate of #13413 and by extension #13698 (that's the root cause) so I'm going to go ahead and close down this issue, but thanks for reporting 👍 🐛 🕵️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants