-
-
Notifications
You must be signed in to change notification settings - Fork 792
Alerts for external validation errors in ObjectBrowserWidget #6827
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for plone-components canceled.
|
✅ Deploy Preview for plone-components canceled.
|
@alexandreIFB we already have a suggested fix for this issue at: #6810 Can you please take a look there? |
@@ -354,8 +366,7 @@ export class ObjectBrowserWidgetComponent extends Component { | |||
return ( | |||
<FormFieldWrapper | |||
{...this.props} | |||
// At the moment, OBW handles its own errors and validation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sneridagh What did you mean by this comment? With this fix, can it be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remember now why did I write this. Probably I tried and failed, are we sure it covers all the use cases?
Can we have Cypress tests with a battery of use cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't remember now why did I write this.
@sneridagh Well, if you don't remember, it's better to remove the comment. It will confuse more than explain. lol
Probably I tried and failed, are we sure it covers all the use cases? Can we have Cypress tests with a battery of use cases?
This PR is for displaying the error message in ObjectBrowserWidget. We have tested other widgets and they display the error message. Only ObjectBrowserWidget does not display it. @alexandreIFB can do a test for ObjectBrowserWidget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that these changes fix the issue.
Thanks!
Solution
To solve this problem, I combine this.state.errors (internal errors) with this.props.error (external errors) before passing them to the FormFieldWrapper.
Testing Instructions
To simulate the issue and verify the fix:
Save Teaser without providing Target ( href).
Closes #6787