Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] getParts.xql fails if part-names can't be translated #502

Open
feuerbart opened this issue Dec 15, 2024 · 1 comment · May be fixed by #511
Open

[BUG] getParts.xql fails if part-names can't be translated #502

feuerbart opened this issue Dec 15, 2024 · 1 comment · May be fixed by #511
Assignees
Milestone

Comments

@feuerbart
Copy link
Contributor

feuerbart commented Dec 15, 2024

Describe the problem
When opening measure-based view of a source with parts, getParts.xql throws an error:

/db/apps/Edirom-Online/data/xql/getParts.xqlexerr:ERROR The actual return type does not match the sequence type declared in the function's signature: eutil:getLanguageString(xs:string, xs:string*, xs:string) xs:string. Expected cardinality: exactly one, got 0. [at line 264, column 41, source: /db/apps/Edirom-Online/data/xqm/eutil.xqm]

In function:
eutil:getLanguageString(xs:string, xs:string*, xs:string) [227:12:/db/apps/Edirom-Online/data/xqm/eutil.xqm]
eutil:getPartLabel(node(), xs:string) [32:22:/db/apps/Edirom-Online/data/xqm/eutil.xqm]

i was able to track the problem down:
getParts.xql will try to translate the names of the parts with the edirom-lang-(de|en).xml-file
(e.g. <entry key="perfMedium.perfRes.voice" value="Voice (singing)"/>)
by calling eutil:getPartLabel(), which calls eutil:getLanguageString() to resolve the lang-key from the lang-file.
if the key (in my case perfMedium.perfRes.Set (3) Violoncello/Contrabbasso) does not exist, the return-value will be empty and not match the functions return key and an error is thrown.

explicitly checking the the returned value from the lang-file and returning an empty string if nothing was returned, solved the error: adding
let $string := if(string-length($string) != 0) then ($string) else ("")
to the end of eutil:getLanguageString()

i cant tell if there might be any sideeffects by adding this line. can someone confirm that its safe?

it probably might be good to rethink translations (esp. of part-names) and implement them consequently (goto-menu with parts doesnt make use of translations so far).
Rel #155

To Reproduce

  1. Setup Exist with current Edirom-Online develop and open-faust data
  2. Open source A3, go to measure-based view
  3. Nothing will be shown, because getParts.xql throws error

Expected behavior
no error should be thrown and the name of the parts should be displayed

Data
open-faust dataset: https://git.uni-paderborn.de/kio/open-faust

Edirom information

  • Edirom-Online version: v1.0.0-beta.7 on develop-branch (ae50cb9)

Environment information

  • Chrome
  • MEI-Version of file: 3.0.0
@feuerbart feuerbart changed the title [BUG] [BUG] getParts.xql fails if part-names can't be translated (aka no lang-key found) Dec 15, 2024
@feuerbart feuerbart changed the title [BUG] getParts.xql fails if part-names can't be translated (aka no lang-key found) [BUG] getParts.xql fails if part-names can't be translated Dec 15, 2024
@feuerbart
Copy link
Contributor Author

had a quick look at #302, seems to be fixed there: 741a51a

@krHERO krHERO reopened this Dec 18, 2024
@krHERO krHERO added this to the 1.0.0 milestone Dec 18, 2024
@krHERO krHERO moved this from Done to In Progress in Edirom Development Dec 18, 2024
feuerbart pushed a commit to feuerbart/Edirom-Online that referenced this issue Dec 18, 2024
@feuerbart feuerbart moved this from In Progress to Ready for Review in Edirom Development Dec 18, 2024
@bwbohl bwbohl moved this from Ready for Review to In Progress in Edirom Development Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants