chenejac / VIVOTestMigration

0 stars 0 forks source link

VIVO-1900: i18n - Adding a spanish label to an article causes an error #1784

Closed chenejac closed 4 years ago

chenejac commented 4 years ago

Dominik Feldschnieders (Migrated from VIVO-1900) said:

With a fresh VIVO instanz and the given sample data ([https://wiki.lyrasis.org/display/VIVODOC19x/Sample+Data]) i tried to add an spanish label to an article. Go to the article, edit label with language set to spanish ( you do not need to edit it) and click "Editar etiqueta" (Edit Label).

This error will show up:

Se produjo un error en el sistema.Mensaje de error: java.lang.Exception: Errors processing required N3. The EditConfiguration should be setup so that if a submission passes validation, there will not be errors in the required N3. [line: 1, col: 137] Bad language tag N3: <http://vivo.mydomain.edu/individual/n3954> <http://www.w3.org/2000/01/rdf-schema#label> "Derrida's influence on political rhetoric"@es- .Traza de errores (Traza completa disponible en el registro de VIVO): java.lang.Error: java.lang.Exception: Errors processing required N3. The EditConfiguration should be setup so that if a submission passes validation, there will not be errors in the required N3. [line: 1, col: 137] Bad language tag N3: <http://vivo.mydomain.edu/individual/n3954> <http://www.w3.org/2000/01/rdf-schema#label> "Derrida's influence on political rhetoric"@es- . at edu.cornell.mannlib.vitro.webapp.edit.n3editing.controller.ProcessRdfFormController.processRequest(ProcessRdfFormController.java:100) at edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet.doGet(FreemarkerHttpServlet.java:108) at edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet.doPost(FreemarkerHttpServlet.java:199) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet.service(VitroHttpServlet.java:71) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1226) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.PageRoutingFilter.doNonDisplayPage(PageRoutingFilter.java:112) at edu.cornell.mannlib.vitro.webapp.filters.PageRoutingFilter.doFilter(PageRoutingFilter.java:103) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.ClickjackFilter.doFilter(ClickjackFilter.java:34) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.RequestModelsPrep.doFilter(RequestModelsPrep.java:59) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.URLRewriterFilter.doFilter(URLRewriterFilter.java:40) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.JSessionStripFilter.doFilter(JSessionStripFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.CachingResponseFilter.produceBasicResponse(CachingResponseFilter.java:321) at edu.cornell.mannlib.vitro.webapp.filters.CachingResponseFilter.doFilter(CachingResponseFilter.java:120) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionFilter.doFilter(LocaleSelectionFilter.java:64) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.CharsetEncodingFilter.doFilter(CharsetEncodingFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.SessionTimeoutLimitingFilter.doFilter(SessionTimeoutLimitingFilter.java:41) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at edu.cornell.mannlib.vitro.webapp.filters.StartupStatusDisplayFilter.doFilter(StartupStatusDisplayFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.Exception: Errors processing required N3. The EditConfiguration should be setup so that if a submission passes validation, there will not be errors in the required N3. [line: 1, col: 137] Bad language tag N3: <http://vivo.mydomain.edu/individual/n3954> <http://www.w3.org/2000/01/rdf-schema#label> "Derrida's influence on political rhetoric"@es- . at edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.ProcessRdfForm.parseN3ToRDF(ProcessRdfForm.java:412) at edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.ProcessRdfForm.parseN3ToChange(ProcessRdfForm.java:302) at edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.ProcessRdfForm.editExistingStatements(ProcessRdfForm.java:175) at edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.ProcessRdfForm.process(ProcessRdfForm.java:88) at edu.cornell.mannlib.vitro.webapp.edit.n3editing.controller.ProcessRdfFormController.processRequest(ProcessRdfFormController.java:97) ... 62 moreCausada por: java.lang.Exception: Errors processing required N3. The EditConfiguration should be setup so that if a submission passes validation, there will not be errors in the required N3. [line: 1, col: 137] Bad language tag N3: <http://vivo.mydomain.edu/individual/n3954> <http://www.w3.org/2000/01/rdf-schema#label> "Derrida's influence on political rhetoric"@es- . at
chenejac commented 4 years ago

Dominik Feldschnieders said:

I think the the interesting part is

bad language tag N3: <http://vivo.mydomain.edu/individual/n3954> <http://www.w3.org/2000/01/rdf-schema#label> "Derrida's influence on political rhetoric"@es- . at
chenejac commented 4 years ago

Andrew Woods said:

I am able to reproduce the issue in this ticket.

chenejac commented 4 years ago

Andrew Woods said:

The bug appears to be in the fact that there is no check for vreq.getLocale().getCountry() being empty. https://github.com/vivo-project/Vitro/blob/sprint-i18n/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/ProcessRdfForm.java#L219

chenejac commented 4 years ago

Dominik Feldschnieders said:

You were right, that was the problem. I have corrected not only the part that causes this error but all the ones I have found which could also lead to this or similar errors.

[PR für Vitro |[https://github.com/vivo-project/Vitro/pull/181]] with description

[PR für VIVO|[https://github.com/vivo-project/VIVO/pull/182]]

chenejac commented 4 years ago

Andrew Woods said:

Looks good. Minor formatting comment.

chenejac commented 4 years ago

Dominik Feldschnieders said:

I have made the requested formatting changes.

chenejac commented 4 years ago

Andrew Woods said:

Resolved with: https://github.com/vivo-project/Vitro/commit/4f99b0ac922a52ca89a8b10d9d9aa495578d2d8f and https://github.com/vivo-project/VIVO/commit/fd643642c5d980556b34bf9f18f9cf51baa6abb7