ugent-library / biblio-backoffice

Apache License 2.0
7 stars 0 forks source link

Cannot add author without first name #1108

Closed mietcls closed 1 year ago

mietcls commented 1 year ago

Bug description

Cannot add author without first name.

Steps to Reproduce

  1. Go to People & Affiliations on https://backoffice.biblio.ugent.be/publication/01GVZJDJEQF4T1X19JC7PWZKBN?redirect-url=%2Fpublication%3Fq%3D01GVZJDJEQF4T1X19JC7PWZKBN%26sort%3Ddate-updated-desc&show=contributors
  2. Click on the name found in this document: https://ugentbe-my.sharepoint.com/:w:/g/personal/miet_claes_ugent_be/EYS8yR9SXjdAk3xhlwJkpgQBQQ8bNKt4v-IUS7ma2NmhQQ?e=HrKFln
  3. Try switching them to an UGent author, by removing the little dot
  4. Save roles
  5. See error

Screenshots

Scherm­afbeelding 2023-05-30 om 09 08 55 Scherm­afbeelding 2023-05-30 om 09 09 21 Scherm­afbeelding 2023-05-30 om 09 09 24 Scherm­afbeelding 2023-05-30 om 09 09 43

Expected behavior

We require a first or a last name, not both. If this is not possible: at least not for known UGent authors.

Note: Is it time to rethink the "full name – first- and last name" idea?

Automatic testing scenario

Need to be checked if this is correct (depending on the possibilities described in "expected behaviour", but is this description for a test high-level enough @verheyenkoen?

Additional context

According to the reviewers, we used to be able to add those names when entering "missing".

verheyenkoen commented 1 year ago

@mietcls Was able to reproduce the error manually but we'd probably need a mock author in the test DB to pick in tests, or should we use the real person's name?

mietcls commented 1 year ago

@verheyenkoen I think mock users in the back-office test environment would probably be a good idea, to be able to catch the cases?

nicolasfranck commented 1 year ago

If we want to replace the current input text boxes (first_name and last_name) by one (full_name), then users also will have to be aware of how to enter. Now first name and last name are concatenated in that order, and searched on. If someone assumes "last-name, first-name" for whatever reason, then he might find nothing or the wrong person (my name in reverse often has that result).

nicolasfranck commented 1 year ago

Also means that we have to fill full_name for every contributor. Otherwise one cannot add an external contributor with just a full name.

Anyway, we can already remove the requirement in biblio frontend for first name and last name in advance (i.e. prefer full_name if provided)

nicolasfranck commented 1 year ago

Other note: if we need the first and last name for external users, then my proposal won't really work, because there is no trust worthy solution to split a full username into first and last name.

netsensei commented 1 year ago

This is a case of falsehoods programmers believe about names (And that's just names of people, since there's a separate discussion about expanding contributors to include legal entities as well. Anyhow, the scope of this issue is names of people.)

So, on the devbranch, with the latest improvements to the contributor code by @nics, this is what I currently can do:

  1. It's not possible to add an external contributor without having both a first name and a last name.
  2. It's possible to add an external contributor having only a last name, by adding a first name placeholder (like the dot). However, switching that to an UGent contributor requires removal of the placeholder in order for the suggest search to kick in and show the UGent contributor as an option.
  3. It's possible to directly add an UGent contributor who has just a last name, simply by searching on their last name. In the example, I can just copy / paste the name into the "last name" field and the system presents them as an UGent contributor.

Proposal:

netsensei commented 1 year ago

@mietcls @nics I've implemented my proposal