Repository navigation
Open
Description
Original issue: ufal#169
Problem
With the author input configured as separate surname/firstname inputs, the item details page shows Hassan,Amad Ul instead of Hassan, Amad Ul — no space after the comma.
Root cause (verified in code) — it is a STORAGE bug; the display renders the stored value verbatim
- The two-input widget is
clarin-name, used only inclariahSubmissionsPageTwo(submission-forms.xml:1618) andteachingSubmissionsPageTwo(:1921) → DH Data and Teaching materials collections. The traditional form's author is a single autocomplete (:193). src/app/shared/form/builder/ds-dynamic-form-ui/models/clarin-name.model.ts:41: the constructor overridesthis.separator = ','(no space) aftersuper(), while the parentDynamicConcatModel(ds-dynamic-concat.model.ts:57) correctly doesconfig.separator + ' '.get value()(59-60) then joinssurname + ',' + firstname→Hassan,Amad Ulis what gets stored.- DI wiring bug (why simply deleting the override is NOT a fix):
parser-factory.ts:27-33definesfieldParserDepsas 5 positional deps ending withTranslateService, butClarinNameFieldParser's 5th constructor parameter isseparator: string(clarin-name-field-parser.ts:25-36) — soseparatorreceives the TranslateService instance andtranslateis undefined.config.separatoris therefore an object, and the hard-coded','in the model is the only functioning separator. - Display side renders storage verbatim:
clarin-shared-util.ts:85(name: authorMV.value) +clarin-item-author-preview.component.html:8({{ author.name }}). - Production archived data is currently clean (a scan of 2363 author values found no
,\Smatch) — the reported value likely lives in an in-flight workspace/workflow item or another instance. Curation must therefore also cover workspace/workflow items; worth asking the reporter where they saw it. - Feedback loop: space-less values get indexed into Solr
author_acand come back as suggestions on the traditional form.
Reproduction (local docker stack)
- Map a collection to
clariahSubmissions/teachingSubmissions(fresh DB has no such handles — create + map; docker compose uses a prebuilt image, config changes need a mount/custom build). - New submission → Author widget: surname
Hassan, first nameAmad Ul→ save. - REST/DB:
dc.contributor.author=Hassan,Amad Ul(no space); the item page shows it without the space.
Suggested fix
clarin-name.model.ts:41: change the override tothis.separator = ', '(do NOT delete it — see the DI bug above). Inget value()(54-68) trim both input values (otherwise a trailing space in the surname yieldsHassan , Amad).set value(70-95): tolerant split on the first comma via/,\s*/+ trim, so legacy space-less values (Hassan,Amad) and new ones (Hassan, Amad) both load correctly into the two inputs (legacy values self-normalize on the next save).- Fix the
ClarinNameFieldParserDI wiring inparser-factory.ts(separator/translate in the right positions). - Tests: join uses
', '+ trims; split of both variants; surname-only value; parser wiring. - QA detector (person values matching
,\S) and one-off curation (including workspace/workflow items) + Solr reindex incl.author_acare tracked in UFAL/Metadata QA detectors, backend hardening and data curation for issues 1388/1387/169 DSpace#1373.
Metadata
Metadata
Assignees
Labels
No labels
Activity