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

Umbraco 13, Block Grid > RTE > Embedded Block Editors Don't Always Render #15494

Closed
asawyermarathon opened this issue Dec 20, 2023 · 5 comments · Fixed by #15583
Closed

Umbraco 13, Block Grid > RTE > Embedded Block Editors Don't Always Render #15494

asawyermarathon opened this issue Dec 20, 2023 · 5 comments · Fixed by #15583
Labels

Comments

@asawyermarathon
Copy link
Contributor

asawyermarathon commented Dec 20, 2023

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

13.0.2

Bug summary

  1. RTE fields directly in a document type that have embedded blocks always render correctly
  2. Block Grid fields that contain RTE fields that have embedded blocks sometimes render, and sometimes don't.

Specifics

No response

Steps to reproduce

  1. Start a new Umbraco 13.0.2 site
  2. Create a new "Home" doctype with a Block Grid field of alias "content". Select the default "Demo" Block Editors, they will work. Also add a new RTE field, for example "richTextField"
  3. Create the front end template view for the home doctype.
  4. Create a simple element type to be used as a block editor ("testBlock"). Add a single textstring field of alias "content"
  5. Update the datatype settings of the umbBlockGridDemoRichTextBlock rich text editor to accept embedded block editors, select your "testBlock" as an example.
  6. Create an embedded RTE Block Editor view file in ~\Views\Partials\RichText\Components\testBlock.cshtml
  7. Create a new Home node, populate both fields with an RTE, and embed a block in both. Save and Publish.
  8. View the front end. The RTE field will work, the Block Grid > RTE field will not. After some time, after clearing caches and republishing, the Block Grid > RTE field will sometimes render, sometimes not. Try adding multiple RTE instances to the Blog Grid. Some render, others do not.

https://github.com/umbraco/Umbraco-CMS/assets/87725234/76eebdd7-d363-4746-8a31-e450aa6e1f76
https://github.com/umbraco/Umbraco-CMS/assets/87725234/a2d2e4d4-f2a7-48cf-a143-29f70fd1e5b3

devenv_IPG7t9b3UA
devenv_cc2KK2plH1
devenv_ObsTn1AcBg
chrome_oAr5yMFC96
chrome_tcgDQe3g2W
chrome_yZof8H5Tif

Content:
chrome_K1sLQrbscw

Output:
chrome_0xY1MThaKT

Expected result / actual result

I expected RTE with an embedded Block Editor to be parsed and the block rendered when in a Block Grid field.


This item has been added to our backlog AB#36554

Copy link

Hi there @asawyermarathon!

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

@elit0451
Copy link
Contributor

Thanks for reaching out @asawyermarathon 👋 and for the detailed description of how to reproduce the issue

I was able to reproduce the issue, so we will take a look.

Have a joyful new year! 🎊

@lassefredslund lassefredslund added the state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks label Jan 10, 2024
@nobledm
Copy link

nobledm commented Jan 10, 2024

Using version 13.0.3
I have discovered some potentially related info ^^ Though, this is just general Rich Text areas (was using elements inside a Block List), not specific to Block Grid.

  • If a Block is the last element in an RTE it does not render
  • If there is any text inserted after the block it does render consistently

I did have a Block render once if it was the last element by editing out some text elsewhere in the rich text. But then it disappeared again after another save. Possibly because the empty p-tag was removed.

image
image

@skttl
Copy link
Contributor

skttl commented Jan 16, 2024

I noticed that when the block is added, it's added with a class attribute (probably from AngularJS)
image

This makes it not match the Regex found in https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/RichTextParsingRegexes.cs

So I guess, either the regex should be updated to allow for the class attribute, or the class attribute should be removed somehow.

The regex could be changed to <umb-rte-block(?:-inline)?(?: class=\"(.[^\"]*)\")? data-content-udi=\"(?<udi>.[^\"]*)\"><!--Umbraco-Block--><\/umb-rte-block(?:-inline)?>, then it matches both with and without the class attribute.

@Migaroez
Copy link
Contributor

Migaroez commented Feb 7, 2024

fixed in #15583

@Migaroez Migaroez added release/13.2.0 and removed state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks state/reproduced release/13.2.0 labels Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants