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

Multi-node Tree Picker property editor in Block List block causes duplicated block previews #66

Open
timeverts opened this issue Sep 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@timeverts
Copy link

Which Umbraco.Community.BlockPreview version are you using?

1.10.3

Which Umbraco version are you using? For example: 10.4.0 - don't just write v10

13.4.1

Bug summary

When an element type (block) within a Block List contains a Multi-Node Tree Picker property editor, the preview of the first block in the block list is rendered for all other blocks. Even after removing the block containing the multi-node tree picker and re-saving the content, the block previews are still duplicated.

Steps to reproduce

Just a note, in testing this, I was using a clean install of Umbraco with the official Umbraco Starter Kit added to it.

  1. Create a Block List property editor containing several blocks (e.g. the Headline and Rich Text blocks that come in the demo set of blocks).
  2. Ensure the blocks use the block preview from the package (~/App_Plugins/Umbraco.Community.BlockPreview/views/block-preview.html).
  3. Create a new block (element type) and add a Multi-node Tree Picker property editor to it that picks up to 1 item from a collection of content in the CMS.
    For example, a Blogpost block that contains a multi-node tree picker property editor to pick the blog post:
    image
    image
  4. Create a Razor view for the Blogpost block and save it in Views/Partials/blocklist/Components/.
    For example:
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListItem>;
@using ContentModels = Umbraco13Demo.Web.Models.PublishedContent;
@{
    var blogpostBlock = (BlogpostBlock)Model.Content;

    var blogpost = blogpostBlock.Content as ContentModels.Blogpost;
}
<div class="component blogpost">
    <h4>@blogpost.Name</h4>
</div>
  1. Go to a CMS page that uses the Block List property editor and create an instance of 'Headline' block (or other block). Then add an instance of the block that uses the multi-node tree picker property editor (e.g. Blogpost block).

Expected result / actual result

Each block should render a preview using the HTML defined for that block's razor file. Instead, the first block's preview is duplicated for all other blocks.

image

Even after removing the block containing the multi-node tree picker, the previews still seem to be duplicated.

image

IMPORTANT NOTE: This bug does not occur in a Block Grid property editor.

@timeverts timeverts added the bug Something isn't working label Sep 3, 2024
@timeverts
Copy link
Author

Hi @rickbutterfield. Thanks for this amazing plugin!
Just wondering whether you might have some availability soon to investigate this ticket?

@rickbutterfield
Copy link
Owner

Hey @timeverts! There was another issue raised recently where Block List items were duplicated, fixed in 1.10.4 (see some of the later comments on #64)

Please could you try that first, and if it doesn't fix it I'll investigate further!

@kevin9092
Copy link
Contributor

I have tested this in Umbraco v13.2, v13.4.1, & v13.5.1 and I cannot replicate this issue using BlockPreview v1.10.4. I think this issue is safe to close. @timeverts if this is still happening on v1.10.4, please provide some additional information and I would be happy to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants