Plugins are not run correctly when running musescore in converter mode.

• Jan 10, 2020 - 17:21
Reported version
3.x-dev
Priority
P2 - Medium
Type
Plugins
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
PR created
Regression
Yes
Workaround
No
Project

Running musescore with both plugins (-p) and conversion (-o) at the command line will ignore the plugin listed, and convert without running plugins.

To reproduce this issue, simply launch musescore with a plugin such as transpose_0.qml, and a musescore file, i.e.:

mscore -p transpose_0.qml -o Music.pdf Music.mscx

This is due to two small error in musescore.cpp:

  • in the overloaded function convert(QString&, QString&), the conversion routine is called, but without a plugin name. This will cause the plugin name to be ignored at the command line.
  • In the overloaded function convert(QString&, QJsonArray&, QString&), the current loaded score is not appended to the list of scores.

The former error means that no user-specified plugins will be run when in "conversion" mode, the latter means that if they are run, they will encounter errors when they try and modify the current score, as there is no current score available.

These errors are due to a wider issue with brittle command-line behaviour that should be addressed in a future release.

Details on my debugging (along with a small patch that will fix this issue) can be found at this forum node: https://musescore.org/en/node/299531

I plan to open a PR with a cleaned up version of the patch that will fix this issue.