Skip to content

Commit 8df2bbb

Browse files
author
Mohammed Taha Khan
committed
fix: display DOI validation errors in deposit form
1 parent 14a0afc commit 8df2bbb

File tree

1 file changed

+6
-2
lines changed
  • invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/fields/Identifiers/PIDField/components

1 file changed

+6
-2
lines changed

invenio_rdm_records/assets/semantic-ui/js/invenio_rdm_records/src/deposit/fields/Identifiers/PIDField/components/UnmanagedIdentifierCmp.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,19 @@ export class UnmanagedIdentifierCmp extends Component {
4646
const { localIdentifier } = this.state;
4747
const { form, fieldPath, helpText, pidPlaceholder, disabled } = this.props;
4848
const fieldError = getFieldErrors(form, fieldPath);
49+
const displayError =
50+
fieldError && typeof fieldError === "object" && fieldError.message
51+
? fieldError.message
52+
: fieldError;
4953
return (
5054
<>
51-
<Form.Field width={8} error={fieldError}>
55+
<Form.Field width={8} error={displayError}>
5256
<Form.Input
5357
onChange={(e, { value }) => this.onChange(value)}
5458
value={localIdentifier}
5559
placeholder={pidPlaceholder}
5660
width={16}
57-
error={fieldError}
61+
error={displayError}
5862
disabled={disabled}
5963
/>
6064
</Form.Field>

0 commit comments

Comments
 (0)