volto icon indicating copy to clipboard operation
volto copied to clipboard

fix: show only error message in toast instead of stringified JSON

Open Shyam-Raghuwanshi opened this issue 2 weeks ago • 2 comments

Now shows only error message in toast instead of stringified JSON

How to reproduce

  • go to - https://demo.plone.org/controlpanel/dexterity-types/Document/schema
  • Try adding any new field using - Add field
  • And fill only the required field - title
  • Try to save

Before image

After

image

Shyam-Raghuwanshi avatar Dec 11 '25 16:12 Shyam-Raghuwanshi

@Shyam-Raghuwanshi managed to simulate this error. Were you able to get past this error? Were you able to add a field? I filled in all the fields and it's still giving the error? Could it be a problem with the demo?

wesleybl avatar Dec 12 '25 02:12 wesleybl

Hi @wesleybl , actually, I never tried filling in all the fields. I was thinking this would work after we fill all the fields, but now I tried and found that it's a problem. We are unable to add a field and don't have any idea what the error is, but I will find out soon. If you have any idea about it, please share it with me too.

Shyam-Raghuwanshi avatar Dec 12 '25 07:12 Shyam-Raghuwanshi

Hi, @wesleybl, just fixed the problem. The problem was in the backend Here is the PR https://github.com/plone/plone.restapi/pull/1969

Shyam-Raghuwanshi avatar Dec 17 '25 18:12 Shyam-Raghuwanshi

@Shyam-Raghuwanshi No, the problem seems to be that Volto's SchemaWidget is setting incorrect factory names that don't match the available field types in the backend.

@robgietema Is it possible this is a side effect of the work you did for volto-form-block?

  • Choosing the Text field is setting the factory to label_text_field but it should be Text
  • There is a Full Name field available in the widget which doesn't match any field type available in a Plone content type schema

davisagli avatar Dec 18 '25 05:12 davisagli

@Shyam-Raghuwanshi No, the problem seems to be that Volto's SchemaWidget is setting incorrect factory names that don't match the available field types in the backend.

@robgietema Is it possible this is a side effect of the work you did for volto-form-block?

  • Choosing the Text field is setting the factory to label_text_field but it should be Text
  • There is a Full Name field available in the widget which doesn't match any field type available in a Plone content type schema

That is possible but as far as I know I didn't change the factory fields and kept them the way they were. You can however now change the available fields (with the factories) in the config.

robgietema avatar Dec 20 '25 12:12 robgietema