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

Strange behavior for validation of RTE inside a block list field #15993

Closed
Pieter-vdh opened this issue Apr 5, 2024 · 4 comments
Closed

Strange behavior for validation of RTE inside a block list field #15993

Pieter-vdh opened this issue Apr 5, 2024 · 4 comments

Comments

@Pieter-vdh
Copy link

Pieter-vdh commented Apr 5, 2024

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

13.2.2

Bug summary

When using Block List fields that contain an Element Type including a mandatory Rich Text Editor, the validation gives a vague message when publishing.

Specifics

This might be related to a previous bug report: #15270

An item that contains a Block List always seems to give a vague error when publishing if the element inside the list contains a Rich Text Editor.
This seems to only be the case for mandatory field validation. Not for custom validation.

Here is what I did:
My page item contains a Block List with elements of type ValidationElement. This element type contains 3 fields:

  • Title (Textstring + Mandatory)
  • MandatoryText (Rich Text Editor + Mandatory)
  • CustomValidationText (Rich Text Editor + Custom validation as email)

I edit my page item and add a new ValidationElement to my list.
I don't fill in any values and try to submit. This gives me the validation error that my Title field is mandatory. No message for the other 2 fields.
image

I fill in the title and submit. No validation error at this point.
I save and publish. I get a red validation error that something inside my list is wrong.
image

I see that the CustomValidationText is not correctly filled in. However, no message for the empty MandatoryText field.
image

I fill in this field (in this case with an email address). I submit and get no error again at this point. Once again, I save and publish.
I now get a yellow warning error that 'some' validation failed. But no specific direction as to where or what.
image

When I open my list element details, there is no validation message anywhere.
I press 'Save and publish' a second time and now I get a red validation error.
image

The field with the error is now also marked.
image

What is causing this inconsistency?
Especially the vague yellow warning is very confusing to content creators as they won't realize that you have to click 'Save and publish' a second time to get the real error message.

Any help would be appreciated

Steps to reproduce

Create an Element Type with 3 fields:

  • Title (Textstring + Mandatory)
  • MandatoryText (Rich Text Editor + Mandatory)
  • CustomValidationText (Rich Text Editor + Custom validation as email)

Create a Document Type with 1 field:

  • List (Block List that allows adding the created Element Type)

Follow the steps in the description above.

Expected result / actual result

Expected result:
Validation is consistent and will show either when clicking 'Submit' or 'Save and publish' for all fields.

Actual result:
The Rich Text Fields behave differently based on their settings. Mandatory RTE fields produce a yellow warning error on 'Save and publish' that is too vague to be useful, especially when using complicated Document Types with many different Block Lists.


This item has been added to our backlog AB#43158

Copy link

github-actions bot commented Apr 5, 2024

Hi there @Pieter-vdh!

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

@NguyenThuyLan
Copy link
Contributor

NguyenThuyLan commented Jul 25, 2024

Hi @Pieter-vdh , I agree this is a really annoying bug and needs to be fixed. I will let the team know. Thank you for reporting.
I reproduced this issue and noticed that in v14, mandatory fields don't even have * marked as required.
Btw, the CustomValidationText should not be warned because it is not mandatory and can be empty.
image

Copy link

Hi @Pieter-vdh,

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 :-)

@Pieter-vdh
Copy link
Author

Pieter-vdh commented Jul 26, 2024

Hi @NguyenThuyLan

Yes, you are correct. The CustomValidationText Should not report a problem when left empty. As you can see in this screenshot it does do that. So this is another bug in my opinion.
image

Thank you for opening this up to the community.

@nielslyngsoe nielslyngsoe self-assigned this Aug 15, 2024
@nielslyngsoe nielslyngsoe added state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks and removed affected/v14 labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants