Last modified: 2013-09-07 14:43:43 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 T52235, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50235 - Object of class Blob could not be converted to string
Object of class Blob could not be converted to string
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
REL1_21-branch
All All
: High critical (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-26 14:06 UTC by joshua
Modified: 2013-09-07 14:43 UTC (History)
5 users (show)

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


Attachments

Description joshua 2013-06-26 14:06:43 UTC
Trying to create or run a math page results in a 500 page error. looking in apache log you see

PHP Catchable fatal error:  Object of class Blob could not be converted to string in /var/www/rnd-wiki/extensions/Math/MathRenderer.php on line 162.

Database is Postgresql
Server is Ubuntu 64bit
Comment 1 physikerwelt 2013-06-26 14:10:08 UTC
I'll have a look at this problem, which version of Postgresql do you use?
Comment 2 joshua 2013-06-26 14:19:44 UTC
9.1.9

i'd be happy to do a join.me or something like that to let you look into it

Installed software

Product	Version
MediaWiki	1.21.1
PHP	5.4.9-4ubuntu2.1 (apache2handler)
PostgreSQL	9.1.9
BlueSpice for MediaWiki	1.21.0
Comment 3 joshua 2013-06-26 14:23:20 UTC
(In reply to comment #1)
> I'll have a look at this problem, which version of Postgresql do you use?

9.1.9

i'd be happy to do a join.me or something like that to let you look into it

Installed software

Product    Version
MediaWiki    1.21.1
PHP    5.4.9-4ubuntu2.1 (apache2handler)
PostgreSQL    9.1.9
BlueSpice for MediaWiki    1.21.0
Comment 4 physikerwelt 2013-06-26 17:33:16 UTC
Hi,

a quick fix is to uncomment this line, since it only prints out debug output.
I'll try to get a postgresql instance to submit a proper fix.

Best
Physikerwelt
Comment 5 joshua 2013-06-26 17:48:59 UTC
its not commented for me
 wfDebugLog( "Math", 'store entry for $' . $this->tex . '$ in database (hash:' . $this->getInputHash() . ')\n' );
Comment 6 joshua 2013-06-26 17:53:11 UTC
now im getting 


Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): s_k
Comment 7 physikerwelt 2013-06-26 17:54:39 UTC
sorry I mean comment it out, i.e.
// wfDebugLog( "Math", 'store entry for $' . $this->tex . '$ in database (hash:'
. $this->getInputHash() . ')\n' );

a real fix could be to replace the line by
wfDebugLog( "Math", 'store entry for $' . $this->tex . '$ in database (hash:' . var_export( $this->getInputHash() , false ) . ')\n' );
Comment 8 physikerwelt 2013-06-26 18:02:29 UTC
(In reply to comment #6)
> now im getting 
> 
> 
> Failed to parse (PNG conversion failed; check for correct installation of
> latex
> and dvipng (or dvips + gs + convert)): s_k

Ok this is quite normal if you have not installed latex and dvipng.
You can try out MathML rendering which does not require Latex to be installed
by setting 

$wgUseLaTeXML = true; // enabeling MathJax as rendering option
$wgDefaultUserOptions['math'] = MW_MATH_LATEXML; // setting LaTeXML as default rendering option (optional)

in the LocalSettings.php file.
See
http://www.mediawiki.org/wiki/Extension:Math
for more information.
Comment 9 joshua 2013-06-26 18:12:20 UTC
tried that and its still coming up with the same error someone said in the render.ml they had to define the absolute path of latex and dvipng.

do you know these?
Comment 10 physikerwelt 2013-06-26 18:14:18 UTC
I probably can not fix the original bug. In the latest version the debug output is

wfDebugLog( "Math", 'store entry for $' . $this->tex . '$ in database (hash:' . $this->hash . ')\n' );

this should not cause problems since it is a text field.

So the general solution would be to update to the latest version.
Comment 11 joshua 2013-06-26 18:17:12 UTC
i am at the latest stable version
Comment 12 physikerwelt 2013-06-26 18:18:08 UTC
I know it's a little bit hard to fix errors, since the page is cached and the cache stores the errors as well.
So if you change something in the config, you have to add ?action=purge to the url in order to trigger another run of the math extension code.
Comment 13 physikerwelt 2013-06-26 18:21:32 UTC
Yes. I know. Maybe there should be a new release since that version is 4 month old.
Comment 14 physikerwelt 2013-06-26 18:30:41 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > now im getting 
> > 
> > 
> > Failed to parse (PNG conversion failed; check for correct installation of
> > latex
> > and dvipng (or dvips + gs + convert)): s_k
> 
> Ok this is quite normal if you have not installed latex and dvipng.
> You can try out MathML rendering which does not require Latex to be installed
> by setting 
> 
> $wgUseLaTeXML = true; // enabeling MathJax as rendering option
> $wgDefaultUserOptions['math'] = MW_MATH_LATEXML; // setting LaTeXML as
> default
> rendering option (optional)
> 
> in the LocalSettings.php file.
> See
> http://www.mediawiki.org/wiki/Extension:Math
> for more information.

does that work for you?
Comment 15 joshua 2013-06-26 18:34:48 UTC
nope

this is what i have

require_once("$IP/extensions/Math/Math.php");
$wgTmpDirectory = "$wgScriptPath/images/tmp";
$wgTexvc = '/var/www/rnd-wiki/extensions/Math/math/texvc';
$wgUseLaTeXML = true; // enabeling MathJax as rendering option
$wgDefaultUserOptions['math'] = MW_MATH_LATEXML;
Comment 16 joshua 2013-06-26 18:39:56 UTC
in my apache error log you see

Use of undefined constant MW_MATH_LATEXML - assumed 'MW_MATH_LATEXML'
Comment 17 physikerwelt 2013-06-26 18:43:52 UTC
oh sorry my fault.

This only works with the current master branch
if you use git try

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Math.git
git checkout master

in that case this config should be sufficient

require_once("$IP/extensions/Math/Math.php");
//$wgTmpDirectory = "$wgScriptPath/images/tmp";
//$wgTexvc = '/var/www/rnd-wiki/extensions/Math/math/texvc';
$wgUseLaTeXML = true; // enabeling MathJax as rendering option
$wgDefaultUserOptions['math'] = MW_MATH_LATEXML;
Comment 18 joshua 2013-06-26 19:00:45 UTC
Failed to parse (LaTeXML MathML is invalid XML.): C_{f_q}
Comment 19 physikerwelt 2013-06-26 19:07:09 UTC
ok. yet another problem. This is because the a dependency to a newer version of the core.

You can update your core version to the master version as well by
git checkout master in the mediawiki root dir, or uncomment the xml check in
MathLaTeXML.php line 204
 	/**
	 * Checks if the input is valid MathML,
	 * and if the root element has the name math
	 * @param string $XML
	 * @return boolean
	 */
	static public function isValidMathML( $XML ) {

just add return true; there.
Comment 20 db [inactive,noenotif] 2013-06-27 18:00:53 UTC
See Gerrit change #60987 for the blob fix
Comment 21 Sumana Harihareswara 2013-08-27 14:06:39 UTC
Since the change has been merged, can we close this bug as resolved?
Comment 22 physikerwelt 2013-09-06 17:39:14 UTC
I think so.

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


Navigation
Links