Last modified: 2013-04-23 22:24:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49537, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47537 - PHP fatal error when override_midi is used and a Lilypond error is encountered
PHP fatal error when override_midi is used and a Lilypond error is encountered
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Score (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-23 10:08 UTC by Braeburn
Modified: 2013-04-23 22:24 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Braeburn 2013-04-23 10:08:24 UTC
In addition to bug 47536, attempting to use the "override_midi" property on a score snippet that throws a Lilypond error causes a PHP fatal error.

For instance, this:

     <score override_midi="Las notas Musicales .MID">\relative c' { \cadenzaOn c1 \cadenzaOff }</score>

yields this upon attempts to save or preview the page:

     PHP fatal error in /usr/local/apache/common-local/php-1.22wmf2/extensions/Score/Score.body.php line 130:
     Object of class ForeignDBFile could not be converted to string
Comment 1 Sam Reed (reedy) 2013-04-23 21:00:19 UTC
	private static function throwCallException( $message, $output, $factoryDir = false ) {
		/* clean up the output a bit */
		if ( $factoryDir ) {
			$output = str_replace( $factoryDir, '...', $output );
		}
		throw new ScoreException(
			$message->rawParams(
				Html::rawElement( 'pre',
					array(),
					htmlspecialchars( $output )
				)
			)
		);
	}

Line 130 is the str_replace. Though it's already dying and trying to show a message...
Comment 2 Sam Reed (reedy) 2013-04-23 21:03:15 UTC
[23-Apr-2013 10:04:17] Catchable fatal error: Object of class ForeignDBFile could not be converted to string at /usr/local/apache/common-local/php-1.22wmf2/extensions/Score/Score.body.php on line 130
Server: mw1078
Method: POST
URL: http://en.wikipedia.org/w/index.php?title=Note&action=submit
Backtrace:
#0 /usr/local/apache/common-local/php-1.22wmf2/extensions/Score/Score.body.php(130): str_replace(Array, '...', 'Processing `/tm...')
#1 /usr/local/apache/common-local/php-1.22wmf2/extensions/Score/Score.body.php(595): Score::throwCallException(Object(Message), 'Processing `/tm...', Array)
#2 /usr/local/apache/common-local/php-1.22wmf2/extensions/Score/Score.body.php(419): Score::generatePngAndMidi('\relative c' { ...', Array)
#3 /usr/local/apache/common-local/php-1.22wmf2/extensions/Score/Score.body.php(343): Score::generateHTML(Object(Parser), '\relative c' { ...', Array)
#4 [internal function]: Score::render('\relative c' { ...', Array, Object(Parser), Object(PPFrame_DOM))
#5 /usr/local/apache/common-local/php-1.22wmf2/includes/parser/Parser.php(3918): call_user_func_array('Score::render', Array)
#6 /usr/local/apache/common-local/php-1.22wmf2/includes/parser/Preprocessor_DOM.php(1154): Parser->extensionSubstitution(Array, Object(PPFrame_DOM))
#7 /usr/local/apache/common-local/php-1.22wmf2/includes/parser/Parser.php(3075): PPFrame_DOM->expand(Object(PPNode_DOM), 0)
#8 /usr/local/apache/common-local/php-1.22wmf2/includes/parser/Parser.php(1153): Parser->replaceVariables('== Written note...')
#9 /usr/local/apache/common-local/php-1.22wmf2/includes/parser/Parser.php(383): Parser->internalParse('== Written note...')
#10 /usr/local/apache/common-local/php-1.22wmf2/includes/content/WikitextContent.php(300): Parser->parse('== Written note...', Object(Title), Object(ParserOptions), true, true, NULL)
#11 /usr/local/apache/common-local/php-1.22wmf2/includes/EditPage.php(3081): WikitextContent->getParserOutput(Object(Title), NULL, Object(ParserOptions))
#12 /usr/local/apache/common-local/php-1.22wmf2/includes/EditPage.php(2103): EditPage->getPreviewText()
#13 /usr/local/apache/common-local/php-1.22wmf2/includes/EditPage.php(441): EditPage->showEditForm()
#14 /usr/local/apache/common-local/php-1.22wmf2/includes/actions/EditAction.php(50): EditPage->edit()
#15 /usr/local/apache/common-local/php-1.22wmf2/includes/actions/EditAction.php(76): EditAction->show()
#16 /usr/local/apache/common-local/php-1.22wmf2/includes/Wiki.php(439): SubmitAction->show()
#17 /usr/local/apache/common-local/php-1.22wmf2/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#18 /usr/local/apache/common-local/php-1.22wmf2/includes/Wiki.php(565): MediaWiki->performRequest()
#19 /usr/local/apache/common-local/php-1.22wmf2/includes/Wiki.php(458): MediaWiki->main()
#20 /usr/local/apache/common-local/php-1.22wmf2/index.php(59): MediaWiki->run()
#21 /usr/local/apache/common-local/w/index.php(3): require('/usr/local/apac...')
#22 {main}
Comment 3 Gerrit Notification Bot 2013-04-23 22:14:34 UTC
Related URL: https://gerrit.wikimedia.org/r/60591 (Gerrit Change If34de5d78125eb64fbc2e1c2cf1a3a30cfc22018)
Comment 4 Sam Reed (reedy) 2013-04-23 22:21:07 UTC
The bad error handling is now fixed


Now it is:

Processing `/tmp/MWLP.677c274f6084bc6ca2429fe3e0fbdb94/file.ly'
Parsing...
Interpreting music... 
warning: cannot find or create `Timing' called `'
warning: cannot find or create `Timing' called `'
Preprocessing graphical objects...
Interpreting music... 
warning: cannot find or create `Timing' called `'
warning: cannot find or create `Timing' called `'

exited with status: 139
Comment 5 Sam Reed (reedy) 2013-04-23 22:24:11 UTC
It's not override_midi related, you seem to have invalid lilypad syntax.

On a random test:


<score raw="1" override_midi="Las notas Musicales .MID">
\header {
  title =       "Boci-boci tarka"
  enteredby =   "grin"
}

\version "2.14.2"

\score {
\new Staff <<
 \relative c' 
 { 
  \key c \major
  \time 4/4
  c\mf e c e g2 g2  
  c,4 e c e g2 <g e>2   
  c4 b a g f2 a2 
  g4 f e d c2 <c c'>2
 }

 \addlyrics {
 Bo -- ci bo -- ci tar -- ka
 Se fü -- le se far -- ka
 O -- da me -- gyűnk lak -- ni
 A -- hol te -- jet kap -- ni
 }
>>

\layout { }
\midi { }

}

</score>


Doesn't error about the override_midi

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links