File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ const IdentifierField = ({ formConfig }) => {
35
35
"This is your community's unique identifier. You will be able to access your community through the URL:"
36
36
) }
37
37
< br />
38
- { `${ formConfig . SITE_UI_URL } /communities/${ values [ "community " ] [ "slug" ] } ` }
38
+ { `${ formConfig . SITE_UI_URL } /communities/${ values [ "metadata " ] [ "slug" ] } ` }
39
39
</ >
40
40
) ;
41
41
@@ -139,11 +139,18 @@ class CommunityCreateForm extends Component {
139
139
const { errors, message } = communityErrorSerializer ( error ) ;
140
140
141
141
if ( message ) {
142
- this . setGlobalError ( message ) ;
142
+ this . setGlobalError ( "The form contains errors or missing fields. Please verify before submitting" ) ;
143
143
}
144
144
145
145
if ( errors ) {
146
- errors . map ( ( { field, messages } ) => setFieldError ( field , messages [ 0 ] ) ) ;
146
+ errors . map ( ( { field, messages } ) => {
147
+ // Check if the field is already prefixed with "metadata"
148
+ if ( ! field . startsWith ( "metadata" ) ) {
149
+ // Add "metadata" prefix if not already present
150
+ field = `metadata.${ field . split ( '.' ) . pop ( ) } ` ;
151
+ }
152
+ setFieldError ( field , messages [ 0 ] ) ;
153
+ } ) ;
147
154
}
148
155
}
149
156
} ;
You can’t perform that action at this time.
0 commit comments