fix: show only error message in toast instead of stringified JSON
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
After
- [X] I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.
- [X] I verified there aren't other open pull requests for the same change.
- [X] I followed the guidelines in Contributing to Volto.
- [X] I successfully ran code linting checks on my changes locally.
- [X] I successfully ran unit tests on my changes locally.
- [X] I successfully ran acceptance tests on my changes locally.
- [X] If needed, I added new tests for my changes.
- [X] If needed, I added documentation for my changes, either in the Storybook or narrative documentation.
- [X] I included a change log entry in my commits.
@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?
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.
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 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
@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.