chenejac / VIVOTestMigration

0 stars 0 forks source link

VIVO-1925: i18n: Editing labels results in new label #1809

Closed chenejac closed 3 years ago

chenejac commented 3 years ago

Dominik Feldschnieders (Migrated from VIVO-1925) said:

This bug can be seen when editing a label where the language of the label is different than the site language context.

For example, if the sample-data (https://github.com/vivo-project/sample-data/blob/master/sample-data.n3) is loaded, add a new label for "Rhetoric" while in a language context other than English (e.g. German). http://localhost:8080/vivo/editRequestDispatch?subjectUri=http%3A%2F%2Fvivo.mydomain.edu%2Findividual%2Fn2854&editForm=edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.VIVOManageLabelsGenerator&predicateUri=http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23label

Then, switch the site language context to English, and click on the "Edit" button next to the new, German label. Edit the value and save.

Notice the bug: the German label was not actually edited, but rather, a new label was added with an English langTag.

The resolution to this bug should be for the label that is being edited to be changed... not having a new label with the site language context.

chenejac commented 3 years ago

Dominik Feldschnieders said:

The bug is fixed with this [PR|[https://github.com/vivo-project/Vitro/pull/188]].

The funny thing is that i needed to add the  first added and then removed fix from the previous ticket (vivo-1915) again :D and some other things

chenejac commented 3 years ago

Andrew Woods said:

Pending response to code review comments.

chenejac commented 3 years ago

Dominik Feldschnieders said:

I changed the empty or null check und added an comment.  [PR|[https://github.com/vivo-project/Vitro/pull/188]]

chenejac commented 3 years ago

Andrew Woods said:

Pending response to code review comment.

chenejac commented 3 years ago

Dominik Feldschnieders said:

I found a solution but it is more of a workaround then a fix.

There are two cases, which differ only in the URI ( in editConfig) with which they occur. One is editing a label from the profile page (in case there is only one label for this instance) and the other is editing it from the "manage Labels" page (in case there are several labels in different languages). In the first case the global language should be used for the new label and the old label should be kept. In the second case the language of the label being edited should be kept and only the text should be changed.

 Image upload is not working here, i added some in the [PR|[https://github.com/vivo-project/Vitro/pull/188]]

 

chenejac commented 3 years ago

Andrew Woods said:

Well done. One minor comment before merge.

chenejac commented 3 years ago

Dominik Feldschnieders said:

thanks, i changed it

chenejac commented 3 years ago

Andrew Woods said:

Resolved by: https://github.com/vivo-project/Vitro/commit/284bb4a4cbf55d84b908b536181eb15560c78601