jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/399868 )
Change subject: Make image check precede MIDI check
......................................................................
Make image check precede MIDI check
`score-noimages` was in the HTML generation stage, while MIDI checking
was in the PNG generation stage. This meant that MIDI checking took
precedence, making the error message unhelpful to the real issue.
This change places the image checking before MIDI checking right after
engraving.
Bug: T116392
Change-Id: If01818ffc474865ebb6cc57b2dccc9f665d841f0
---
M includes/Score.php
1 file changed, 6 insertions(+), 3 deletions(-)
Approvals:
Brion VIBBER: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Score.php b/includes/Score.php
index 5d2597e..ca32ab4 100644
--- a/includes/Score.php
+++ b/includes/Score.php
@@ -502,9 +502,6 @@
'title' => $pageNumb
] );
}
- } else {
- /* No images; this may happen in raw mode or
when the user omits the score code */
- throw new ScoreException( wfMessage(
'score-noimages' ) );
}
if ( $options['generate_audio'] ) {
$length = $metaData[basename( $audioPath
)]['length'];
@@ -589,6 +586,7 @@
$factoryLy = "$factoryDirectory/file.ly";
$factoryMidi = "$factoryDirectory/file.midi";
$factoryImage = "$factoryDirectory/file.png";
+ $factoryPage1 = "$factoryDirectory/file-page1.png";
$factoryImageTrimmed = "$factoryDirectory/file-trimmed.png";
/* Generate LilyPond input file */
@@ -646,6 +644,11 @@
self::throwCallException( wfMessage(
'score-compilererr' ), $output,
$options['factory_directory'] );
}
+
+ if ( !file_exists( $factoryImage ) && !file_exists(
$factoryPage1 ) ) {
+ throw new ScoreException( wfMessage( 'score-noimages' )
);
+ }
+
$needMidi = false;
if ( !$options['raw'] || $options['generate_audio'] &&
!$options['override_midi'] ) {
$needMidi = true;
--
To view, visit https://gerrit.wikimedia.org/r/399868
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If01818ffc474865ebb6cc57b2dccc9f665d841f0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: Ebe123 <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits