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

Two Column Layout error "Something went wrong rendering a preview" #12

Closed
37Stars opened this issue Mar 9, 2023 · 5 comments
Closed

Comments

@37Stars
Copy link

37Stars commented Mar 9, 2023

I created a new empty project to try the BlockPreview. These are my steps:

  1. Created a new Umbraco 10.4 solution. (Also get the same error with 11.2).
  2. Added BlockPreview 1.1.1 via nuget
  3. Created a new Data Type named Content Block Grid.
  4. Within Content Block Grid, click button to create Demo Blocks. That added 4 new Document Types.
  5. Created a new Document Type named Web Page with a single data type, Content Block Grid, named Page Content. Set allow as Root.
  6. Created a new Web Page named Home and added the Two Column Layout to the Page Content.
  7. Updated the umbBlockGridDemoTwoColumnLayoutBlock.cshtml view (located in \Views\Partials\blockgrid\Components) from Html.GetBlockGridItemAreasHtmlAsync(Model) to Html.GetPreviewBlockGridItemAreasHtmlAsync(Model). Both produce the same error.

When editing the Home page in the back office the Two Column Layout displays the message "Something went wrong rendering a preview".

The blocks Headline, Image and Rich Text display without any issues. Am I missing something?

@rickbutterfield
Copy link
Owner

rickbutterfield commented Mar 13, 2023

Hi @37Stars!

Firstly, thank you for such great replication steps! This has made it really easy to trace down the bug.

Secondly, are you using ModelsBuilder at all in your solution? I've presumed not because you're creating a new solution out of the box. If it's the case that you're not, I think I've got a fix!

@37Stars
Copy link
Author

37Stars commented Mar 13, 2023

I can do either, but would prefer to use ModelsBuilder.

@rickbutterfield
Copy link
Owner

rickbutterfield commented Mar 14, 2023

Excellent, I think I've got a fix then! I've only managed to replicate your issue when ModelBuilder was set to InMemoryAuto, or one of the SourceCode modes but not generated yet, but this fixes one of the first issues I found with the code!

@rickbutterfield
Copy link
Owner

rickbutterfield commented Mar 14, 2023

@37Stars please test version 1.1.2 whenever you get chance! https://www.nuget.org/packages/Umbraco.Community.BlockPreview/1.1.2#readme-body-tab

@37Stars
Copy link
Author

37Stars commented Mar 14, 2023

@rickbutterfield yes, that works great!

The only issue remaining is an Umbraco issue. When I add content to one of those two columns, Umbraco displays the properties panel for the two-column layout over the "Add Content" panel. Clicking "Discard Changes" takes care of that.

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

No branches or pull requests

2 participants