chenejac / VIVOTestMigration

0 stars 0 forks source link

VIVO-1983: Manage labels page uses context and request models inconsistently #1866

Closed chenejac closed 3 years ago

chenejac commented 3 years ago

Brian Lowe (Migrated from VIVO-1983) said:

As discovered in Michel Héon's RC testing, if labels for an individual exist in multiple languages, clinking the manage labels link followed by the edit link for a label in a language other than the one the interface is currently set to results in an error of the type:

 

java.lang.Error: No match to existing data property "http://www.w3.org/2000/01/rdf-schema#label" statement for subject "http://vivo.mydomain.edu/individual/n2560" via key 1374944497

 

The value is displayed on the page because it is retrieved using an unfitered context model in EditConfigurationUtils:238 ... ModelAccess.on(session.getServletContext()).getOntModel() ....

 

but the literal to edit is retrieved in RDFLabelGenerator:301 ... ModelAccess.on(vreq).getOntModel(); .... where the value is not found because it is in the wrong language.

 

The simplest change would be to replace RDFLabelGenerator:301 with the context model, but this raises a UI issue.  The manage labels form still assumes that you only want one label per individual and does not let you create a new one if one already exists.  In a multilingual environment, it seems that it would be more consistent with the current behavior of the other editing forms if it showed only the values for the current language, prompting you to delete extraneous values for that language only.  You would then switch the language selector to edit the other languages.

If the latter approach is desired, then both retrieval and editing need to use the request model, not the context model.  It is likely that whatever query controls the visibility of the manage labels icon (versus the pencil icon) on the profile page also needs to be looked at.

chenejac commented 3 years ago

Brian Lowe said:

Tandem pull requests:

[https://github.com/vivo-project/Vitro/pull/232]

https://github.com/vivo-project/VIVO/pull/240

chenejac commented 3 years ago

Georgy Litvinov said:

 

Test results[^test_results.pdf]

chenejac commented 3 years ago

Georgy Litvinov said:

[https://github.com/vivo-project/VIVO/commit/e1dc5c9775f84a395b005a8fa86f32b476bb15a2]

[https://github.com/vivo-project/Vitro/commit/9565fbd9251d6fcba5bf053457a945010cd7f6a4]