Skip to content

UFAL/Author name (clarin-name widget) stored without space after comma #1382

Description

@milanmajchrak

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 in clariahSubmissionsPageTwo (submission-forms.xml:1618) and teachingSubmissionsPageTwo (: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 overrides this.separator = ',' (no space) after super(), while the parent DynamicConcatModel (ds-dynamic-concat.model.ts:57) correctly does config.separator + ' '. get value() (59-60) then joins surname + ',' + firstnameHassan,Amad Ul is what gets stored.
  • DI wiring bug (why simply deleting the override is NOT a fix): parser-factory.ts:27-33 defines fieldParserDeps as 5 positional deps ending with TranslateService, but ClarinNameFieldParser's 5th constructor parameter is separator: string (clarin-name-field-parser.ts:25-36) — so separator receives the TranslateService instance and translate is undefined. config.separator is 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 ,\S match) — 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_ac and come back as suggestions on the traditional form.

Reproduction (local docker stack)

  1. 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).
  2. New submission → Author widget: surname Hassan, first name Amad Ul → save.
  3. REST/DB: dc.contributor.author = Hassan,Amad Ul (no space); the item page shows it without the space.

Suggested fix

  1. clarin-name.model.ts:41: change the override to this.separator = ', ' (do NOT delete it — see the DI bug above). In get value() (54-68) trim both input values (otherwise a trailing space in the surname yields Hassan , Amad).
  2. 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).
  3. Fix the ClarinNameFieldParser DI wiring in parser-factory.ts (separator/translate in the right positions).
  4. Tests: join uses ', ' + trims; split of both variants; surname-only value; parser wiring.
  5. QA detector (person values matching ,\S) and one-off curation (including workspace/workflow items) + Solr reindex incl. author_ac are tracked in UFAL/Metadata QA detectors, backend hardening and data curation for issues 1388/1387/169 DSpace#1373.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions